From 059290f1616e9e1790772177a387f2e1597c67e0 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 23 Feb 2021 15:19:38 +0000 Subject: [PATCH] release v31 (#737) # Changelog - New aegir configuration setup, with proper merging between cli flags and config file - `aegir` property in package.json can be used to provide configuration in addition to the current `.aegir.js` file. - All command can be configured with config file or package.json property - Release command will pickup all the other commands config - New improved documentation with typedoc 0.20 with better support for commonjs - `.js` files are now outputted by the build command when `--ts-repo` flag is enabled - Linter config upgraded to 2.0.0 - The lint command was improved (we were using deprecated methods) and the output changed a bit. - The output formatter now writes proper clickable paths to the errors - Aegir is fully typed now - TS command now copies all `.d.ts` inside the `src` folder to the `dist` and if a folder called `types` exists inside the root folder that folder is also copied to `dist`. - `bundle-size` github action doesn't generate types - Theres a new experimental `aegir check` command that will tell you about : - duplicates in the bundle - files that use node builtins but dont have browser swaps or npm dependencies for it. - TS runtime transpilation for node tests uses esbuild-register instead of babel to be ultra fast - Support for running tests in Webkit - Coverage supported in node and browser tests, the output can be upload directly to codecov no need to run nyc to generate a report. Notes: electron coverage is not supported yet and you can still use nyc as you would now. - Removed webpack, karma and some babel packages - Build and test use `esbuild` for ultra fast bundles - Test uses `playwright-test` instead of karma, for faster runs, cov support, webkit support and more - Node tests coverage uses `c8`instead of nyc for faster runs - Commands removed - `update-last-successful-build` - `update-rc` - `update-release-branch-lockfiles` - `publish-rc` - `commit-lint` - Electron tests can be started in parallel and electron bin download will not fail. - Aegir exports config types so the user can take advantage of type check and completion in .aegir.js - Don't forget to add .aegir.js to your tsconfig.json, when generating types aegir will ignore it automatically ```jsx 'use strict' /** @type {import('aegir').PartialOptions} */ module.exports = { } ``` - Hooks removed in favor of `test.before` and `test.after` see migration guide - `test.before` receives aegir options as a param - `test.after` receives aegir options and the return value of `test.before` so you can cleanup whatever before started. - `test.after` run even if tests fail --- .aegir.js | 7 +- .github/workflows/main.yml | 5 +- CHANGELOG.md | 93 + README.md | 344 +- actions/bundle-size/dist/index.js | 62517 ++++++---------- actions/bundle-size/package.json | 8 +- actions/bundle-size/utils.js | 7 +- cli.js | 23 +- cmds/lint.js | 28 - cmds/publish-rc.js | 42 - cmds/release.js | 109 - cmds/test.js | 94 - cmds/update-last-successful-build.js | 27 - cmds/update-rc.js | 32 - cmds/update-release-branch-lockfiles.js | 26 - cmds/z-commitlint.js | 43 - fixtures.js | 3 - md/github-actions.md | 83 + md/migration-to-v31.md | 223 + md/ts-jsdoc.md | 5 +- package.json | 95 +- src/build/index.js | 152 +- src/checks/commitlint-travis.js | 113 - {cmds => src/cmds}/build.js | 15 +- src/cmds/check.js | 190 + {cmds => src/cmds}/docs.js | 14 +- src/cmds/lint.js | 49 + src/cmds/release.js | 131 + {cmds => src/cmds}/test-dependant.js | 10 +- src/cmds/test.js | 96 + {cmds => src/cmds}/ts.js | 16 +- {cmds => src/cmds}/z-dependency-check.js | 28 +- {cmds => src/cmds}/z-lint-package-json.js | 12 +- src/config/babelrc.js | 51 - src/config/karma-entry.js | 13 - src/config/karma.conf.js | 147 - src/config/pw-test.js | 4 + src/config/register.js | 7 - src/config/user.js | 178 +- src/config/webpack.config.js | 193 - src/dependency-check.js | 98 +- src/docs/index.js | 19 +- src/fixtures.browser.js | 35 - src/fixtures.js | 33 - src/index.js | 7 + src/lint.js | 61 +- src/publish-rc/index.js | 74 - src/release/bump.js | 10 +- src/release/changelog.js | 11 + src/release/commit.js | 3 +- src/release/contributors.js | 7 +- src/release/github.js | 7 + src/release/index.js | 189 +- src/release/prerelease.js | 38 +- src/release/publish.js | 21 +- src/release/push.js | 10 +- src/release/tag.js | 3 +- src/test-dependant/index.js | 77 +- src/test/browser.js | 102 +- src/test/electron.js | 94 +- src/test/index.js | 74 +- src/test/node.js | 138 +- src/ts/index.js | 7 +- src/ts/typedoc-plugin.js | 10 +- src/types.d.ts | 304 + src/types.ts | 122 - src/update-last-successful-build/index.js | 91 - src/update-rc/index.js | 52 - src/update-release-branch-lockfiles/index.js | 65 - src/utils.js | 85 +- test/acceptance.sh | 55 - test/browser.spec.js | 2 +- .../custom-config-package-json/package.json | 2 +- test/config/fixtures/custom-config/.aegir.js | 13 +- .../custom-user-async-hooks/.aegir.js | 10 +- test/config/user.js | 31 +- test/dependants.js | 72 +- test/dependency-check.js | 125 +- test/fixtures.js | 4 +- .../dependency-check/fail-prod/index.js | 1 + test/fixtures/dependency-check/fail/index.js | 1 + .../pass-certain-files/derp/foo.js | 1 + .../pass-certain-files/index.js | 1 + test/fixtures/dependency-check/pass/index.js | 1 + .../with-aegir-config/index.js | 1 + .../monorepo/packages/submodule/test.js | 1 + test/fixtures/test-dependant/project/test.js | 1 + test/lint.js | 52 +- test/node.js | 1 - test/utils.js | 32 - test/utils/echo-server.js | 12 +- tsconfig-types.json | 11 - tsconfig.json | 5 +- utils/chai.js | 7 +- utils/echo-server.js | 70 +- utils/fixtures.browser.js | 78 + utils/fixtures.js | 63 + utils/get-port.js | 10 +- 98 files changed, 27586 insertions(+), 40157 deletions(-) delete mode 100644 cmds/lint.js delete mode 100644 cmds/publish-rc.js delete mode 100644 cmds/release.js delete mode 100644 cmds/test.js delete mode 100644 cmds/update-last-successful-build.js delete mode 100644 cmds/update-rc.js delete mode 100644 cmds/update-release-branch-lockfiles.js delete mode 100644 cmds/z-commitlint.js delete mode 100644 fixtures.js create mode 100644 md/github-actions.md create mode 100644 md/migration-to-v31.md delete mode 100644 src/checks/commitlint-travis.js rename {cmds => src/cmds}/build.js (70%) create mode 100644 src/cmds/check.js rename {cmds => src/cmds}/docs.js (80%) create mode 100644 src/cmds/lint.js create mode 100644 src/cmds/release.js rename {cmds => src/cmds}/test-dependant.js (80%) create mode 100644 src/cmds/test.js rename {cmds => src/cmds}/ts.js (77%) rename {cmds => src/cmds}/z-dependency-check.js (70%) rename {cmds => src/cmds}/z-lint-package-json.js (82%) delete mode 100644 src/config/babelrc.js delete mode 100644 src/config/karma-entry.js delete mode 100644 src/config/karma.conf.js create mode 100644 src/config/pw-test.js delete mode 100644 src/config/register.js delete mode 100644 src/config/webpack.config.js delete mode 100644 src/fixtures.browser.js delete mode 100644 src/fixtures.js delete mode 100644 src/publish-rc/index.js create mode 100644 src/types.d.ts delete mode 100644 src/types.ts delete mode 100644 src/update-last-successful-build/index.js delete mode 100644 src/update-rc/index.js delete mode 100644 src/update-release-branch-lockfiles/index.js delete mode 100755 test/acceptance.sh delete mode 100644 test/utils.js delete mode 100644 tsconfig-types.json create mode 100644 utils/fixtures.browser.js create mode 100644 utils/fixtures.js diff --git a/.aegir.js b/.aegir.js index 913d85ea7..a8380e4d5 100644 --- a/.aegir.js +++ b/.aegir.js @@ -1 +1,6 @@ -// Only for testing +/** @type {import("./src/types").PartialOptions} */ +module.exports = { + docs: { + entryPoint: 'utils' + } +} \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de2ff7258..7a5b44bfe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,7 @@ jobs: - uses: actions/checkout@v2 - run: npm install - run: npm run lint + - run: ./cli.js ts -p check - name: dependencies run: ./cli.js dep-check -- -i aegir test-node: @@ -24,7 +25,7 @@ jobs: with: node-version: ${{ matrix.node }} - run: yarn - - run: npx nyc --reporter=lcov npm run test:node -- --bail + - run: npm run test:node -- --bail --cov - uses: codecov/codecov-action@v1 test-chrome: needs: check @@ -39,4 +40,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: yarn - - run: npm run test:browser -- -- --browsers FirefoxHeadless \ No newline at end of file + - run: npm run test:browser -- -- --browser firefox \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ae70f0c33..5961b87c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,96 @@ +# [31.0.0-next.2](https://github.com/ipfs/aegir/compare/v31.0.0-next.1...v31.0.0-next.2) (2021-02-23) + + +### Bug Fixes + +* release ([a1f265e](https://github.com/ipfs/aegir/commit/a1f265e3d8755450f574a3de8152b59e52c32ac1)) + + + +# [31.0.0-next.1](https://github.com/ipfs/aegir/compare/v31.0.0-next.0...v31.0.0-next.1) (2021-02-23) + + + +# [31.0.0-next.0](https://github.com/ipfs/aegir/compare/v30.3.0...v31.0.0-next.0) (2021-02-23) + + +### Bug Fixes + +* action types ([3237ad6](https://github.com/ipfs/aegir/commit/3237ad6b40e5136a47eefd6bd50706653b5adaae)) +* add migration and fix dep-check ([6dedc09](https://github.com/ipfs/aegir/commit/6dedc098e91d86b5a4a39a32d25d8cfa9ffec55f)) +* add src to dep-check prod input ([ce16e7c](https://github.com/ipfs/aegir/commit/ce16e7c24a3d7d8fdc8072cb827cb6af332aba3c)) +* bundle size options ([e83ac97](https://github.com/ipfs/aegir/commit/e83ac97477e64b1df479bf07ee039a443a64c566)) +* check more types ([1001e00](https://github.com/ipfs/aegir/commit/1001e00070b4f6f0dc012347175a6056605c399a)) +* concat dep-check ignore defaults to input ([169edb1](https://github.com/ipfs/aegir/commit/169edb15f8d450c19f824c2281ab323e8d827edc)) +* dep check cmd ([4ef344f](https://github.com/ipfs/aegir/commit/4ef344f2512af2adc57a7cb742b9c840c41af7af)) +* dep-check ignore ([181abe5](https://github.com/ipfs/aegir/commit/181abe54d7fe6c407a13f377ebe7bf32460be08c)) +* dep-check prod input ([9bbb44e](https://github.com/ipfs/aegir/commit/9bbb44e8666e915f40dc619daaaabef598b2cde3)) +* dependency check ([5bc8f64](https://github.com/ipfs/aegir/commit/5bc8f64fbc32f93ea148256f36c84af75300f25e)) +* documentation ([838c165](https://github.com/ipfs/aegir/commit/838c165e1c444640976745b711d8926f3f84633b)) +* electron lock, esbuild-register, node cov with c8, check cmd ([19b7301](https://github.com/ipfs/aegir/commit/19b73019cc68d4bbe731b6cc856b0f536f06a1dc)) +* fix docs paths and update deps ([#726](https://github.com/ipfs/aegir/issues/726)) ([9b7136a](https://github.com/ipfs/aegir/commit/9b7136aacd7637b406208558a4d47e19282fd4e6)) +* fix hooks ([98bf44d](https://github.com/ipfs/aegir/commit/98bf44d2f0e84fd4b6e927d5e59d532de09bd529)) +* fix hooks ([21d5639](https://github.com/ipfs/aegir/commit/21d5639ec425d5b4a654d3e1609075e5eda25d9c)) +* foward options for mocha ([26c2647](https://github.com/ipfs/aegir/commit/26c26472fb7696ef6658fb75dc294f668d461fdd)) +* future node builtin check ([6917d5c](https://github.com/ipfs/aegir/commit/6917d5c67d63f5c4355c2c5f5b66d15375d9e5d3)) +* move cmds to src and remove commit-lint ([ce2bc87](https://github.com/ipfs/aegir/commit/ce2bc87bbc8e31cd9cb60a59e29a663a36056bcc)) +* move fixtures and export types ([b7b7ee4](https://github.com/ipfs/aegir/commit/b7b7ee4b57d0be796fb4df0ffeca2bf83818d8b6)) +* remove ? from utils ([fd5695c](https://github.com/ipfs/aegir/commit/fd5695c9534358c14e9ed522512ab9d9d364c76d)) +* remove another ? ([62cb87d](https://github.com/ipfs/aegir/commit/62cb87d051c358754a98b5cd44f7d6ec649f4947)) +* remove c8 tmp from nyc_output ([e8b4e9f](https://github.com/ipfs/aegir/commit/e8b4e9ff6d85b0ec4efa47729141138bbea75d8b)) +* remove userConfig usage ([ee4bca3](https://github.com/ipfs/aegir/commit/ee4bca3038cfbd837093970b899a9078466cfb4d)) +* scripts ([9000aba](https://github.com/ipfs/aegir/commit/9000abae849ff5a51ce7addf0e0b483dd4923a10)) +* types ([c842d82](https://github.com/ipfs/aegir/commit/c842d821dd6ad84f166a92331164d8403a8a3688)) +* types ([c91c715](https://github.com/ipfs/aegir/commit/c91c715f7586e9f2555d3e1457b36480f2548d02)) +* types and release cmd ([853ea86](https://github.com/ipfs/aegir/commit/853ea8691d46bb355293f7a7671c749e4f85a282)) +* umd and global ([add8ef4](https://github.com/ipfs/aegir/commit/add8ef4abe980f7f0d39ed1e9c67a463bf5bcd44)) +* umd bundle ([8f7f4ae](https://github.com/ipfs/aegir/commit/8f7f4ae2a74031ff990970ebc3e66434acdee29d)) +* update action ([453c80f](https://github.com/ipfs/aegir/commit/453c80f0d455b8c1a2603a227309c24e5fb14459)) +* update action ([3467aed](https://github.com/ipfs/aegir/commit/3467aed0f38b1b800b54b95f6ea82c2a39f08830)) +* update deps ([5260ccb](https://github.com/ipfs/aegir/commit/5260ccb236cdfee0e79238dd13b3a8535859d955)) +* upgrade karma ([#733](https://github.com/ipfs/aegir/issues/733)) ([1212314](https://github.com/ipfs/aegir/commit/12123143b5d75934d54cbf3736db25f97767acf7)) + + +### Features + +* copy .d.ts. to dist ([#738](https://github.com/ipfs/aegir/issues/738)) ([4002b50](https://github.com/ipfs/aegir/commit/4002b5072c6f9e5dfe67e0e5e4f22930bc81d4a6)) +* hooks ([3e09f88](https://github.com/ipfs/aegir/commit/3e09f88157e8eb5e4086904f726d1cc16e46d9f3)) +* rename --ts flag to --ts-repo and fix ts repo support ([#730](https://github.com/ipfs/aegir/issues/730)) ([3d54004](https://github.com/ipfs/aegir/commit/3d5400406db2c912292ddc10b98586b04a41bf5b)) +* ts, build, docs and lint improvements ([#732](https://github.com/ipfs/aegir/issues/732)) ([846bb25](https://github.com/ipfs/aegir/commit/846bb25818f753bea6572194362d7bbdd90d8433)) +* update typedoc and improvemnts to docs cmd ([#727](https://github.com/ipfs/aegir/issues/727)) ([1149281](https://github.com/ipfs/aegir/commit/11492815864cf352ed0bba22eaec5996361439c1)) +* upgrade linter to v2.0.0 ([9f67cb9](https://github.com/ipfs/aegir/commit/9f67cb99531eda4bc0aa4f0fee0b45ebd15264c1)) +* use esbuild and playwright-test ([9a03b99](https://github.com/ipfs/aegir/commit/9a03b991178f4281f26ac7b5d7953e3c3aa40e9c)) + + +### BREAKING CHANGES + +* Major linter upgrade may cause errors. +* Config property `bundlesize.maxSize` is deprecated, use `build.bundlesizeMax` + +* fix: improve docs cmd + +- add more types +- clean code and improve Listr setup + +* feat: big utils clean up + +- remove unnecessary methods +- add some types +- improve `paths` export, with full paths to dist, test, src and package.json folder/file + +* feat: clean lint cmd + +- remove old npm deps semver version checks +- update to the new eslint api +- use a new output formatter that actually gives us links we can click and go to the errors +* old npm deps semver was removed + +* fix: add types for cmd options +* `--ts` flag renamed to `--ts-repo` +* aegir ts -p docs removed use aegir docs directly + + + # [30.3.0](https://github.com/ipfs/aegir/compare/v30.2.0...v30.3.0) (2021-01-05) diff --git a/README.md b/README.md index 340a2db60..b57b86b81 100644 --- a/README.md +++ b/README.md @@ -11,27 +11,14 @@ ## ToC - [Project Structure](#project-structure) -- [CI](#ci) - - [Travis Setup](#travis-setup) - - [Github Action Setup](#github-action-setup) -- [Stack Requirements](#stack-requirements) +- [CLI](#cli) +- [Configuration](#configuration) +- [Continuous Integration](#continuous-integration) - [Testing helpers](#testing-helpers) - - [Fixtures](#fixtures) - - [Echo Server](#echo-server) - - [Get Port](#get-port) -- [Tasks](#tasks) - - [Linting](#linting) - - [Testing](#testing) - - [Coverage](#coverage) - - [Node](#node) - - [Browser](#browser) - - [Building](#building) - - [Generating Webpack stats.json](#generating-webpack-statsjson) - - [Typescript](#typescript) - - [JSDoc Typescript support](#jsdoc-typescript-support) - - [Releasing](#releasing) - - [Scoped Github Token](#scoped-github-token) - - [Documentation](#documentation) +- [Typescript](#typescript) + - [JSDoc Typescript support](#jsdoc-typescript-support) + - [Native Typescript support](#native-typescript-support) +- [Release steps](#release-steps) - [License](#license) ## Project Structure @@ -42,7 +29,7 @@ replication and configuration overhead. All source code should be placed under `src`, with the main entry point being `src/index.js`. -All test files should be placed under `test`. Individual test files should end in `.spec.js` and setup files for the node and the browser should be `test/node.js` and `test/browser.js` respectively. +All test files should be placed under `test`. Individual test files should end in `.spec.js` and will be ran in all environments (node, browser, webworker, electron-main and electron-renderer). To run node specific tests a file named `test/node.js` should be used to require all node test files and the same thing for the other environments with a file named `test/browser.js`. Your `package.json` should have the following entries and should pass `aegir lint-package-json`. @@ -63,267 +50,122 @@ Your `package.json` should have the following entries and should pass `aegir lin } ``` -## CI -### Travis Setup -Check this tutorial https://github.com/ipfs/aegir/wiki/Travis-Setup +## CLI -### Github Action Setup -Check this tutorial https://github.com/ipfs/aegir/wiki/Github-Actions-Setup +Run `aegir --help` -## Stack Requirements - -To bring you its many benefits, `aegir` requires - -- JS written in [Standard](https://github.com/feross/standard) style -- Tests written in [Mocha](https://github.com/mochajs/mocha) -- [Karma](https://github.com/karma-runner/karma) for browser tests - -## Testing helpers -In addition to running the tests `aegir` also provides several helpers to be used by the tests. - -#### Fixtures - -Loading fixture files in node and the browser can be painful, that's why aegir provides -a method to do this. For it to work you have to put your fixtures in the folder `test/fixtures`, and then - -```js -// test/awesome.spec.js -const loadFixture = require('aegir/fixtures') - -const myFixture = loadFixture('test/fixtures/largefixture') -``` - -The path to the fixture is relative to the module root. - -If you write a module like [interface-ipfs-core](https://github.com/ipfs/interface-ipfs-core) -which is to be consumed by other modules tests you need to pass in a third parameter such that -the server is able to serve the correct files. - -For example +```bash +Usage: aegir [options] + +Commands: + aegir build Builds a browser bundle and TS type declarations from the `src` folder. + aegir check Check project + aegir docs Generate documentation from TS type declarations. + aegir lint Lint all project files + aegir release Release your code onto the world + aegir test-dependant [repo] Run the tests of an module that depends on this module to see if the current changes have caused a regression + aegir test Test your code in different environments + aegir ts Typescript command with presets for specific tasks. + aegir dependency-check [input...] Run `dependency-check` cli with aegir defaults. [aliases: dep-check, dep] + aegir lint-package-json Lint package.json with aegir defaults. [aliases: lint-package, lpj] + aegir completion generate completion script + +Global Options: + -h, --help Show help [boolean] + -v, --version Show version number [boolean] + -d, --debug Show debug output. [boolean] [default: false] + --ts-repo Enable support for Typescript repos. [boolean] [default: false] + +Examples: + aegir build Runs the build command to bundle JS code for the browser. + npx aegir build Can be used with `npx` to use a local version + aegir test -t webworker -- --browser firefox If the command supports `--` can be used to forward options to the underlying tool. + npm test -- -- --browser firefox If `npm test` translates to `aegir test -t browser` and you want to forward options you need to use `-- --` instead. + +Use `aegir --help` to learn more about each command. +``` + +## Configuration +Aegir can be fully configured using a config file named `.aegir.js` or the package.json using the property `aegir`. ```js -// awesome-tests module -const loadFixture = require('aegir/fixtures') - -const myFixture = loadFixture('test/fixtures/coolfixture', 'awesome-tests') -``` +// file: .aegir.js - -```js -// tests for module using the awesome-tests -require('awesome-tests') -``` - -```js -// .aegir.js file in the module using the awesome-tests module 'use strict' +/** @type {import('aegir').PartialOptions} */ module.exports = { - karma: { - files: [{ - pattern: 'node_modules/awesome-tests/test/fixtures/**/*', - watched: false, - served: true, - included: false - }] + tsRepo: true, + release: { + build: false } } ``` -#### Echo Server -HTTP echo server for testing purposes. - -```js -const EchoServer = require('aegir/utils/echo-server') -const server = new EchoServer() -await server.start() - -// search params echo endpoint -const req = await fetch('http://127.0.0.1:3000/echo/query?test=one') -console.log(await req.text()) - -// body echo endpoint -const req = await fetch('http://127.0.0.1:3000/echo', { - method: 'POST', - body: '{"key": "value"}' -}) -console.log(await req.text()) - -// redirect endpoint -const req = await fetch('http://127.0.0.1:3000/redirect?to=http://127.0.0.1:3000/echo') -console.log(await req.text()) - -// download endpoint -const req = await fetch('http://127.0.0.1:3000/download?data=helloWorld') -console.log(await req.text()) - -await server.stop() - -``` - -#### Get Port -Helper to find an available port to put a server listening on. -```js -const getPort = require('aegir/utils/get-port') -const port = await getPort(3000, '127.0.0.1') -// if 3000 is available returns 3000 if not returns a free port. - -``` - -## Tasks - -### Linting - -Linting uses [eslint](http://eslint.org/) and [standard](https://github.com/feross/standard) -with [some custom rules](https://github.com/ipfs/eslint-config-aegir) to enforce some more strictness. - -You can run it using - -```bash -$ aegir lint -$ aegir lint-package-json -``` - -### Testing - -You can run it using - -```bash -$ aegir test -``` - -There are also browser and node specific tasks - -```bash -$ aegir test --target node -$ aegir test --target browser -$ aegir test --target webworker -``` - - -### Coverage - -#### Node -You can run your tests with `nyc` using - -```bash -$ npx nyc -s aegir test -t node -# to check the report locally -$ npx nyc report --reporter=html && open coverage/index.html -# or just for a text based reporter -$ npx nyc report -``` -#### Browser -> Not available yet PR open. - - -To auto publish coverage reports from Travis to Codecov add this to -your `.travis.yml` file. - -```yml -after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov -``` - -### Building -The build command builds a browser bundle and TS type declarations from the `src` folder. - -```bash -$ aegir build --help -``` -This will build a browser ready version into `dist`, so after publishing the results will be available under - -``` -https://unpkg.com//dist/index.js +```json +// file: package.json +"main": "src/index.js", +"files": [ + "src", + "dist" +], +"scripts": { + "lint": "aegir lint", + "release": "aegir release", + "build": "aegir build", + "test": "aegir test", + "test:node": "aegir test --target node", + "test:browser": "aegir test --target browser" +}, +"aegir" : { + "tsRepo": false +} ``` +You can find the complete default config [here](https://github.com/ipfs/aegir/blob/master/src/config/user.js#L12) and the types [here](https://github.com/ipfs/aegir/blob/master/src/types.d.ts). -**Specifying a custom entry file for Webpack** - -By default, `aegir` uses `src/index.js` as the entry file for Webpack. You can customize which file to use as the entry point by specifying `entry` field in your user configuration file. To do this, create `.aegir.js` file in your project's root directory and add point the `entry` field to the file Webpack should use as the entry: +## Continuous Integration +Check this template for Github Actions https://github.com/ipfs/aegir/blob/master/md/github-actions.md -```javascript -module.exports = { - entry: "src/browser-index.js", -} -``` +## Testing helpers +In addition to running the tests `aegir` also provides several helpers to be used by the tests. -Webpack will use the specified file as the entry point and output it to `dist/`, eg. `dist/browser-index.js`. +Check the [documentation](https://ipfs.github.io/aegir/) -If `.aegir.js` file is not present in the project, webpack will use `src/index.js` as the default entry file. -#### Generating Webpack stats.json +## Typescript -Pass the `--analyze` option to have Webpack generate a `stats.json` file for the bundle and save it in the project root (see https://webpack.js.org/api/stats/). e.g. +### JSDoc Typescript support ```bash -aegir build --analyze +aegir ts --help ``` -### Typescript +More documentation [here](https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md) -#### JSDoc Typescript support +### Native Typescript support +For native typescript add `--ts-repo` to any command. ```bash -aegir ts --help +aegir build --ts-repo +aegir test --ts-repo ``` -The `ts` command provides type checking (via typescript) in javascript files with [JSDoc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) annotations. - -### Releasing +## Release steps 1. Run linting -2. Run tests -3. Build everything +2. Run type check +3. Run tests 4. Bump the version in `package.json` -5. Generate a changelog based on the git log -6. Commit the version change & `CHANGELOG.md` -7. Create a git tag -8. Run `git push` to `origin/master` -9. Publish a release to Github releases -10. Generate documentation and push to github -11. Publish to npm - -```bash -# Major release -$ aegir release --type major -# Minor relase -$ aegir release --type minor -# Patch release -$ aegir release - -# Major prerelease (1.0.0 -> 2.0.0-rc.0) -$ aegir release --type premajor --preid rc --dist-tag next -# Minor prerelease (1.0.0 -> 1.1.0-rc.0) -$ aegir release --type preminor --preid rc --dist-tag next -# Patch prerelease (1.0.0 -> 1.0.1-rc.0) -$ aegir release --type prepatch --preid rc --dist-tag next - -# Increment prerelease (1.1.0-rc.0 -> 1.1.0-rc.1) -$ aegir release --type prerelease --preid rc --dist-tag next -``` - -> This requires `AEGIR_GHTOKEN` to be set. - -You can also specify the same targets as for `test`. - -If no `CHANGELOG.md` is present, one is generated the first time a release is done. - -You can skip all changelog generation and the github release by passing -in `--no-changelog`. - -If you want no documentation generation you can pass `--no-docs` to the release task to disable documentation builds. - -#### Scoped Github Token - -Performing a release involves creating new commits and tags and then pushing them back to the repository you are releasing from. In order to do this you should create a [GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) and store it in the environmental variable `AEGIR_GHTOKEN`. - -The only access scope it needs is `public_repo`. - -Be aware that by storing it in `~/.profile` or similar you will make it available to any program that runs on your computer. - -### Documentation - -You can use `aegir docs` to generate documentation, this command uses `aegir ts --preset docs` internally. +5. Build everything +6. Update contributors based on the git history +7. Generate a changelog based on the git log +8. Commit the version change & `CHANGELOG.md` +9. Create a git tag +10. Run `git push` to `origin/master` +11. Publish a release to Github releases +12. Generate documentation and push to Github Pages +13. Publish to npm ```bash -$ aegir docs --help +aegir release --help ``` ## License diff --git a/actions/bundle-size/dist/index.js b/actions/bundle-size/dist/index.js index 7346e2dee..2dbe9fa39 100644 --- a/actions/bundle-size/dist/index.js +++ b/actions/bundle-size/dist/index.js @@ -3,15 +3,15 @@ module.exports = /******/ var __webpack_modules__ = ({ /***/ 32932: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* eslint-disable no-console */ -const core = __webpack_require__(42186) -const { context, getOctokit } = __webpack_require__(95438) -const { sizeCheck } = __webpack_require__(31252) +const core = __nccwpck_require__(42186) +const { context, getOctokit } = __nccwpck_require__(95438) +const { sizeCheck } = __nccwpck_require__(31252) const run = async () => { try { @@ -28,12 +28,12 @@ run() /***/ }), /***/ 52605: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const artifact_client_1 = __webpack_require__(48802); +const artifact_client_1 = __nccwpck_require__(48802); /** * Constructs an ArtifactClient */ @@ -46,7 +46,7 @@ exports.create = create; /***/ }), /***/ 48802: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -67,14 +67,14 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const core = __importStar(__webpack_require__(42186)); -const upload_specification_1 = __webpack_require__(10183); -const upload_http_client_1 = __webpack_require__(74354); -const utils_1 = __webpack_require__(36327); -const download_http_client_1 = __webpack_require__(8538); -const download_specification_1 = __webpack_require__(95686); -const config_variables_1 = __webpack_require__(42222); -const path_1 = __webpack_require__(85622); +const core = __importStar(__nccwpck_require__(42186)); +const upload_specification_1 = __nccwpck_require__(10183); +const upload_http_client_1 = __nccwpck_require__(74354); +const utils_1 = __nccwpck_require__(36327); +const download_http_client_1 = __nccwpck_require__(8538); +const download_specification_1 = __nccwpck_require__(95686); +const config_variables_1 = __nccwpck_require__(42222); +const path_1 = __nccwpck_require__(85622); class DefaultArtifactClient { /** * Constructs a DefaultArtifactClient @@ -280,7 +280,7 @@ exports.getRetentionDays = getRetentionDays; /***/ }), /***/ 8538: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -301,15 +301,16 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __importStar(__webpack_require__(35747)); -const core = __importStar(__webpack_require__(42186)); -const zlib = __importStar(__webpack_require__(78761)); -const utils_1 = __webpack_require__(36327); -const url_1 = __webpack_require__(78835); -const status_reporter_1 = __webpack_require__(39081); -const perf_hooks_1 = __webpack_require__(70630); -const http_manager_1 = __webpack_require__(16527); -const config_variables_1 = __webpack_require__(42222); +const fs = __importStar(__nccwpck_require__(35747)); +const core = __importStar(__nccwpck_require__(42186)); +const zlib = __importStar(__nccwpck_require__(78761)); +const utils_1 = __nccwpck_require__(36327); +const url_1 = __nccwpck_require__(78835); +const status_reporter_1 = __nccwpck_require__(39081); +const perf_hooks_1 = __nccwpck_require__(70630); +const http_manager_1 = __nccwpck_require__(16527); +const config_variables_1 = __nccwpck_require__(42222); +const requestUtils_1 = __nccwpck_require__(90755); class DownloadHttpClient { constructor() { this.downloadHttpManager = new http_manager_1.HttpManager(config_variables_1.getDownloadFileConcurrency(), '@actions/artifact-download'); @@ -325,13 +326,9 @@ class DownloadHttpClient { // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately const client = this.downloadHttpManager.getClient(0); const headers = utils_1.getDownloadHeaders('application/json'); - const response = yield client.get(artifactUrl, headers); + const response = yield requestUtils_1.retryHttpClientRequest('List Artifacts', () => __awaiter(this, void 0, void 0, function* () { return client.get(artifactUrl, headers); })); const body = yield response.readBody(); - if (utils_1.isSuccessStatusCode(response.message.statusCode) && body) { - return JSON.parse(body); - } - utils_1.displayHttpDiagnostics(response); - throw new Error(`Unable to list artifacts for the run. Resource Url ${artifactUrl}`); + return JSON.parse(body); }); } /** @@ -347,13 +344,9 @@ class DownloadHttpClient { // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately const client = this.downloadHttpManager.getClient(0); const headers = utils_1.getDownloadHeaders('application/json'); - const response = yield client.get(resourceUrl.toString(), headers); + const response = yield requestUtils_1.retryHttpClientRequest('Get Container Items', () => __awaiter(this, void 0, void 0, function* () { return client.get(resourceUrl.toString(), headers); })); const body = yield response.readBody(); - if (utils_1.isSuccessStatusCode(response.message.statusCode) && body) { - return JSON.parse(body); - } - utils_1.displayHttpDiagnostics(response); - throw new Error(`Unable to get ContainersItems from ${resourceUrl}`); + return JSON.parse(body); }); } /** @@ -403,7 +396,7 @@ class DownloadHttpClient { return __awaiter(this, void 0, void 0, function* () { let retryCount = 0; const retryLimit = config_variables_1.getRetryLimit(); - const destinationStream = fs.createWriteStream(downloadPath); + let destinationStream = fs.createWriteStream(downloadPath); const headers = utils_1.getDownloadHeaders('application/json', true, true); // a single GET request is used to download a file const makeDownloadRequest = () => __awaiter(this, void 0, void 0, function* () { @@ -428,22 +421,40 @@ class DownloadHttpClient { if (retryAfterValue) { // Back off by waiting the specified time denoted by the retry-after header core.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the download`); - yield new Promise(resolve => setTimeout(resolve, retryAfterValue)); + yield utils_1.sleep(retryAfterValue); } else { // Back off using an exponential value that depends on the retry count const backoffTime = utils_1.getExponentialRetryTimeInMilliseconds(retryCount); core.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); - yield new Promise(resolve => setTimeout(resolve, backoffTime)); + yield utils_1.sleep(backoffTime); } core.info(`Finished backoff for retry #${retryCount}, continuing with download`); } }); + const isAllBytesReceived = (expected, received) => { + // be lenient, if any input is missing, assume success, i.e. not truncated + if (!expected || + !received || + process.env['ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION']) { + core.info('Skipping download validation.'); + return true; + } + return parseInt(expected) === received; + }; + const resetDestinationStream = (fileDownloadPath) => __awaiter(this, void 0, void 0, function* () { + destinationStream.close(); + yield utils_1.rmFile(fileDownloadPath); + destinationStream = fs.createWriteStream(fileDownloadPath); + }); // keep trying to download a file until a retry limit has been reached while (retryCount <= retryLimit) { let response; try { response = yield makeDownloadRequest(); + if (core.isDebug()) { + utils_1.displayHttpDiagnostics(response); + } } catch (error) { // if an error is caught, it is usually indicative of a timeout so retry the download @@ -454,14 +465,30 @@ class DownloadHttpClient { yield backOff(); continue; } + let forceRetry = false; if (utils_1.isSuccessStatusCode(response.message.statusCode)) { // The body contains the contents of the file however calling response.readBody() causes all the content to be converted to a string // which can cause some gzip encoded data to be lost // Instead of using response.readBody(), response.message is a readableStream that can be directly used to get the raw body contents - return this.pipeResponseToFile(response, destinationStream, isGzip(response.message.headers)); + try { + const isGzipped = isGzip(response.message.headers); + yield this.pipeResponseToFile(response, destinationStream, isGzipped); + if (isGzipped || + isAllBytesReceived(response.message.headers['content-length'], yield utils_1.getFileSize(downloadPath))) { + return; + } + else { + forceRetry = true; + } + } + catch (error) { + // retry on error, most likely streams were corrupted + forceRetry = true; + } } - else if (utils_1.isRetryableStatusCode(response.message.statusCode)) { + if (forceRetry || utils_1.isRetryableStatusCode(response.message.statusCode)) { core.info(`A ${response.message.statusCode} response code has been received while attempting to download an artifact`); + resetDestinationStream(downloadPath); // if a throttled status code is received, try to get the retryAfter header value, else differ to standard exponential backoff utils_1.isThrottledStatusCode(response.message.statusCode) ? yield backOff(utils_1.tryGetRetryAfterValueTimeInMilliseconds(response.message.headers)) @@ -487,24 +514,40 @@ class DownloadHttpClient { if (isGzip) { const gunzip = zlib.createGunzip(); response.message + .on('error', error => { + core.error(`An error occurred while attempting to read the response stream`); + gunzip.close(); + destinationStream.close(); + reject(error); + }) .pipe(gunzip) + .on('error', error => { + core.error(`An error occurred while attempting to decompress the response stream`); + destinationStream.close(); + reject(error); + }) .pipe(destinationStream) .on('close', () => { resolve(); }) .on('error', error => { - core.error(`An error has been encountered while decompressing and writing a downloaded file to ${destinationStream.path}`); + core.error(`An error occurred while writing a downloaded file to ${destinationStream.path}`); reject(error); }); } else { response.message + .on('error', error => { + core.error(`An error occurred while attempting to read the response stream`); + destinationStream.close(); + reject(error); + }) .pipe(destinationStream) .on('close', () => { resolve(); }) .on('error', error => { - core.error(`An error has been encountered while writing a downloaded file to ${destinationStream.path}`); + core.error(`An error occurred while writing a downloaded file to ${destinationStream.path}`); reject(error); }); } @@ -519,7 +562,7 @@ exports.DownloadHttpClient = DownloadHttpClient; /***/ }), /***/ 95686: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -531,7 +574,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __importStar(__webpack_require__(85622)); +const path = __importStar(__nccwpck_require__(85622)); /** * Creates a specification for a set of files that will be downloaded * @param artifactName the name of the artifact @@ -587,12 +630,12 @@ exports.getDownloadSpecification = getDownloadSpecification; /***/ }), /***/ 16527: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils_1 = __webpack_require__(36327); +const utils_1 = __nccwpck_require__(36327); /** * Used for managing http clients during either upload or download */ @@ -624,13 +667,95 @@ exports.HttpManager = HttpManager; /***/ }), +/***/ 90755: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils_1 = __nccwpck_require__(36327); +const core = __importStar(__nccwpck_require__(42186)); +const config_variables_1 = __nccwpck_require__(42222); +function retry(name, operation, customErrorMessages, maxAttempts) { + return __awaiter(this, void 0, void 0, function* () { + let response = undefined; + let statusCode = undefined; + let isRetryable = false; + let errorMessage = ''; + let customErrorInformation = undefined; + let attempt = 1; + while (attempt <= maxAttempts) { + try { + response = yield operation(); + statusCode = response.message.statusCode; + if (utils_1.isSuccessStatusCode(statusCode)) { + return response; + } + // Extra error information that we want to display if a particular response code is hit + if (statusCode) { + customErrorInformation = customErrorMessages.get(statusCode); + } + isRetryable = utils_1.isRetryableStatusCode(statusCode); + errorMessage = `Artifact service responded with ${statusCode}`; + } + catch (error) { + isRetryable = true; + errorMessage = error.message; + } + if (!isRetryable) { + core.info(`${name} - Error is not retryable`); + if (response) { + utils_1.displayHttpDiagnostics(response); + } + break; + } + core.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + yield utils_1.sleep(utils_1.getExponentialRetryTimeInMilliseconds(attempt)); + attempt++; + } + if (response) { + utils_1.displayHttpDiagnostics(response); + } + if (customErrorInformation) { + throw Error(`${name} failed: ${customErrorInformation}`); + } + throw Error(`${name} failed: ${errorMessage}`); + }); +} +exports.retry = retry; +function retryHttpClientRequest(name, method, customErrorMessages = new Map(), maxAttempts = config_variables_1.getRetryLimit()) { + return __awaiter(this, void 0, void 0, function* () { + return yield retry(name, method, customErrorMessages, maxAttempts); + }); +} +exports.retryHttpClientRequest = retryHttpClientRequest; +//# sourceMappingURL=requestUtils.js.map + +/***/ }), + /***/ 39081: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const core_1 = __webpack_require__(42186); +const core_1 = __nccwpck_require__(42186); /** * Status Reporter that displays information about the progress/status of an artifact that is being uploaded or downloaded * @@ -696,7 +821,7 @@ exports.StatusReporter = StatusReporter; /***/ }), /***/ 40606: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -724,9 +849,9 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __importStar(__webpack_require__(35747)); -const zlib = __importStar(__webpack_require__(78761)); -const util_1 = __webpack_require__(31669); +const fs = __importStar(__nccwpck_require__(35747)); +const zlib = __importStar(__nccwpck_require__(78761)); +const util_1 = __nccwpck_require__(31669); const stat = util_1.promisify(fs.stat); /** * Creates a Gzip compressed file of an original file at the provided temporary filepath location @@ -792,7 +917,7 @@ exports.createGZipFileInBuffer = createGZipFileInBuffer; /***/ }), /***/ 74354: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -813,18 +938,20 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __importStar(__webpack_require__(35747)); -const core = __importStar(__webpack_require__(42186)); -const tmp = __importStar(__webpack_require__(68065)); -const stream = __importStar(__webpack_require__(92413)); -const utils_1 = __webpack_require__(36327); -const config_variables_1 = __webpack_require__(42222); -const util_1 = __webpack_require__(31669); -const url_1 = __webpack_require__(78835); -const perf_hooks_1 = __webpack_require__(70630); -const status_reporter_1 = __webpack_require__(39081); -const http_manager_1 = __webpack_require__(16527); -const upload_gzip_1 = __webpack_require__(40606); +const fs = __importStar(__nccwpck_require__(35747)); +const core = __importStar(__nccwpck_require__(42186)); +const tmp = __importStar(__nccwpck_require__(68065)); +const stream = __importStar(__nccwpck_require__(92413)); +const utils_1 = __nccwpck_require__(36327); +const config_variables_1 = __nccwpck_require__(42222); +const util_1 = __nccwpck_require__(31669); +const url_1 = __nccwpck_require__(78835); +const perf_hooks_1 = __nccwpck_require__(70630); +const status_reporter_1 = __nccwpck_require__(39081); +const http_client_1 = __nccwpck_require__(39925); +const http_manager_1 = __nccwpck_require__(16527); +const upload_gzip_1 = __nccwpck_require__(40606); +const requestUtils_1 = __nccwpck_require__(90755); const stat = util_1.promisify(fs.stat); class UploadHttpClient { constructor() { @@ -852,20 +979,22 @@ class UploadHttpClient { // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately const client = this.uploadHttpManager.getClient(0); const headers = utils_1.getUploadHeaders('application/json', false); - const rawResponse = yield client.post(artifactUrl, data, headers); - const body = yield rawResponse.readBody(); - if (utils_1.isSuccessStatusCode(rawResponse.message.statusCode) && body) { - return JSON.parse(body); - } - else if (utils_1.isForbiddenStatusCode(rawResponse.message.statusCode)) { - // if a 403 is returned when trying to create a file container, the customer has exceeded - // their storage quota so no new artifact containers can be created - throw new Error(`Artifact storage quota has been hit. Unable to upload any new artifacts`); - } - else { - utils_1.displayHttpDiagnostics(rawResponse); - throw new Error(`Unable to create a container for the artifact ${artifactName} at ${artifactUrl}`); - } + // Extra information to display when a particular HTTP code is returned + // If a 403 is returned when trying to create a file container, the customer has exceeded + // their storage quota so no new artifact containers can be created + const customErrorMessages = new Map([ + [ + http_client_1.HttpCodes.Forbidden, + 'Artifact storage quota has been hit. Unable to upload any new artifacts' + ], + [ + http_client_1.HttpCodes.BadRequest, + `The artifact name ${artifactName} is not valid. Request URL ${artifactUrl}` + ] + ]); + const response = yield requestUtils_1.retryHttpClientRequest('Create Artifact Container', () => __awaiter(this, void 0, void 0, function* () { return client.post(artifactUrl, data, headers); }), customErrorMessages); + const body = yield response.readBody(); + return JSON.parse(body); }); } /** @@ -1089,12 +1218,12 @@ class UploadHttpClient { this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); if (retryAfterValue) { core.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); - yield new Promise(resolve => setTimeout(resolve, retryAfterValue)); + yield utils_1.sleep(retryAfterValue); } else { const backoffTime = utils_1.getExponentialRetryTimeInMilliseconds(retryCount); core.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); - yield new Promise(resolve => setTimeout(resolve, backoffTime)); + yield utils_1.sleep(backoffTime); } core.info(`Finished backoff for retry #${retryCount}, continuing with upload`); return; @@ -1146,7 +1275,6 @@ class UploadHttpClient { */ patchArtifactSize(size, artifactName) { return __awaiter(this, void 0, void 0, function* () { - const headers = utils_1.getUploadHeaders('application/json', false); const resourceUrl = new url_1.URL(utils_1.getArtifactUrl()); resourceUrl.searchParams.append('artifactName', artifactName); const parameters = { Size: size }; @@ -1154,19 +1282,18 @@ class UploadHttpClient { core.debug(`URL is ${resourceUrl.toString()}`); // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately const client = this.uploadHttpManager.getClient(0); - const response = yield client.patch(resourceUrl.toString(), data, headers); - const body = yield response.readBody(); - if (utils_1.isSuccessStatusCode(response.message.statusCode)) { - core.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); - } - else if (response.message.statusCode === 404) { - throw new Error(`An Artifact with the name ${artifactName} was not found`); - } - else { - utils_1.displayHttpDiagnostics(response); - core.info(body); - throw new Error(`Unable to finish uploading artifact ${artifactName} to ${resourceUrl}`); - } + const headers = utils_1.getUploadHeaders('application/json', false); + // Extra information to display when a particular HTTP code is returned + const customErrorMessages = new Map([ + [ + http_client_1.HttpCodes.NotFound, + `An Artifact with the name ${artifactName} was not found` + ] + ]); + // TODO retry for all possible response codes, the artifact upload is pretty much complete so it at all costs we should try to finish this + const response = yield requestUtils_1.retryHttpClientRequest('Finalize artifact upload', () => __awaiter(this, void 0, void 0, function* () { return client.patch(resourceUrl.toString(), data, headers); }), customErrorMessages); + yield response.readBody(); + core.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); }); } } @@ -1176,7 +1303,7 @@ exports.UploadHttpClient = UploadHttpClient; /***/ }), /***/ 10183: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1188,10 +1315,10 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __importStar(__webpack_require__(35747)); -const core_1 = __webpack_require__(42186); -const path_1 = __webpack_require__(85622); -const utils_1 = __webpack_require__(36327); +const fs = __importStar(__nccwpck_require__(35747)); +const core_1 = __nccwpck_require__(42186); +const path_1 = __nccwpck_require__(85622); +const utils_1 = __nccwpck_require__(36327); /** * Creates a specification that describes how each file that is part of the artifact will be uploaded * @param artifactName the name of the artifact being uploaded. Used during upload to denote where the artifact is stored on the server @@ -1271,7 +1398,7 @@ exports.getUploadSpecification = getUploadSpecification; /***/ }), /***/ 36327: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1285,11 +1412,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const core_1 = __webpack_require__(42186); -const fs_1 = __webpack_require__(35747); -const http_client_1 = __webpack_require__(39925); -const auth_1 = __webpack_require__(23702); -const config_variables_1 = __webpack_require__(42222); +const core_1 = __nccwpck_require__(42186); +const fs_1 = __nccwpck_require__(35747); +const http_client_1 = __nccwpck_require__(39925); +const auth_1 = __nccwpck_require__(23702); +const config_variables_1 = __nccwpck_require__(42222); /** * Returns a retry time in milliseconds that exponentially gets larger * depending on the amount of retries that have been attempted @@ -1542,6 +1669,20 @@ function createEmptyFilesForArtifact(emptyFilesToCreate) { }); } exports.createEmptyFilesForArtifact = createEmptyFilesForArtifact; +function getFileSize(filePath) { + return __awaiter(this, void 0, void 0, function* () { + const stats = yield fs_1.promises.stat(filePath); + core_1.debug(`${filePath} size:(${stats.size}) blksize:(${stats.blksize}) blocks:(${stats.blocks})`); + return stats.size; + }); +} +exports.getFileSize = getFileSize; +function rmFile(filePath) { + return __awaiter(this, void 0, void 0, function* () { + yield fs_1.promises.unlink(filePath); + }); +} +exports.rmFile = rmFile; function getProperRetention(retentionInput, retentionSetting) { if (retentionInput < 0) { throw new Error('Invalid retention, minimum value is 1.'); @@ -1557,12 +1698,18 @@ function getProperRetention(retentionInput, retentionSetting) { return retention; } exports.getProperRetention = getProperRetention; +function sleep(milliseconds) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise(resolve => setTimeout(resolve, milliseconds)); + }); +} +exports.sleep = sleep; //# sourceMappingURL=utils.js.map /***/ }), /***/ 87351: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1574,8 +1721,8 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const os = __importStar(__webpack_require__(12087)); -const utils_1 = __webpack_require__(5278); +const os = __importStar(__nccwpck_require__(12087)); +const utils_1 = __nccwpck_require__(5278); /** * Commands * @@ -1648,7 +1795,7 @@ function escapeProperty(s) { /***/ }), /***/ 42186: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1669,11 +1816,11 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const command_1 = __webpack_require__(87351); -const file_command_1 = __webpack_require__(717); -const utils_1 = __webpack_require__(5278); -const os = __importStar(__webpack_require__(12087)); -const path = __importStar(__webpack_require__(85622)); +const command_1 = __nccwpck_require__(87351); +const file_command_1 = __nccwpck_require__(717); +const utils_1 = __nccwpck_require__(5278); +const os = __importStar(__nccwpck_require__(12087)); +const path = __importStar(__nccwpck_require__(85622)); /** * The code to exit an action */ @@ -1893,7 +2040,7 @@ exports.getState = getState; /***/ }), /***/ 717: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1908,9 +2055,9 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__webpack_require__(35747)); -const os = __importStar(__webpack_require__(12087)); -const utils_1 = __webpack_require__(5278); +const fs = __importStar(__nccwpck_require__(35747)); +const os = __importStar(__nccwpck_require__(12087)); +const utils_1 = __nccwpck_require__(5278); function issueCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -1955,14 +2102,14 @@ exports.toCommandValue = toCommandValue; /***/ }), /***/ 74087: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Context = void 0; -const fs_1 = __webpack_require__(35747); -const os_1 = __webpack_require__(12087); +const fs_1 = __nccwpck_require__(35747); +const os_1 = __nccwpck_require__(12087); class Context { /** * Hydrate the context from the environment @@ -2012,7 +2159,7 @@ exports.Context = Context; /***/ }), /***/ 95438: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2037,8 +2184,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokit = exports.context = void 0; -const Context = __importStar(__webpack_require__(74087)); -const utils_1 = __webpack_require__(73030); +const Context = __importStar(__nccwpck_require__(74087)); +const utils_1 = __nccwpck_require__(73030); exports.context = new Context.Context(); /** * Returns a hydrated octokit ready to use for GitHub Actions @@ -2055,7 +2202,7 @@ exports.getOctokit = getOctokit; /***/ }), /***/ 47914: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2080,7 +2227,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; -const httpClient = __importStar(__webpack_require__(39925)); +const httpClient = __importStar(__nccwpck_require__(39925)); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -2105,7 +2252,7 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ }), /***/ 73030: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2130,12 +2277,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokitOptions = exports.GitHub = exports.context = void 0; -const Context = __importStar(__webpack_require__(74087)); -const Utils = __importStar(__webpack_require__(47914)); +const Context = __importStar(__nccwpck_require__(74087)); +const Utils = __importStar(__nccwpck_require__(47914)); // octokit + plugins -const core_1 = __webpack_require__(76762); -const plugin_rest_endpoint_methods_1 = __webpack_require__(83044); -const plugin_paginate_rest_1 = __webpack_require__(64193); +const core_1 = __nccwpck_require__(76762); +const plugin_rest_endpoint_methods_1 = __nccwpck_require__(83044); +const plugin_paginate_rest_1 = __nccwpck_require__(64193); exports.context = new Context.Context(); const baseUrl = Utils.getApiBaseUrl(); const defaults = { @@ -2232,14 +2379,14 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), /***/ 39925: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const http = __webpack_require__(98605); -const https = __webpack_require__(57211); -const pm = __webpack_require__(16443); +const http = __nccwpck_require__(98605); +const https = __nccwpck_require__(57211); +const pm = __nccwpck_require__(16443); let tunnel; var HttpCodes; (function (HttpCodes) { @@ -2658,7 +2805,7 @@ class HttpClient { if (useProxy) { // If using proxy, need tunnel if (!tunnel) { - tunnel = __webpack_require__(74294); + tunnel = __nccwpck_require__(74294); } const agentOptions = { maxSockets: maxSockets, @@ -2840,7 +2987,7 @@ exports.checkBypass = checkBypass; /***/ }), /***/ 45211: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2851,7 +2998,7 @@ Object.defineProperty(exports, "__esModule", ({ exports.codeFrameColumns = codeFrameColumns; exports.default = _default; -var _highlight = _interopRequireWildcard(__webpack_require__(36860)); +var _highlight = _interopRequireWildcard(__nccwpck_require__(36860)); function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } @@ -3098,7 +3245,7 @@ function isIdentifierName(name) { /***/ }), /***/ 86607: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3155,9 +3302,9 @@ Object.defineProperty(exports, "isKeyword", ({ } })); -var _identifier = __webpack_require__(66396); +var _identifier = __nccwpck_require__(66396); -var _keyword = __webpack_require__(47249); +var _keyword = __nccwpck_require__(47249); /***/ }), @@ -3207,7 +3354,7 @@ function isKeyword(word) { /***/ }), /***/ 36860: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3219,11 +3366,11 @@ exports.shouldHighlight = shouldHighlight; exports.getChalk = getChalk; exports.default = highlight; -var _jsTokens = _interopRequireWildcard(__webpack_require__(51531)); +var _jsTokens = _interopRequireWildcard(__nccwpck_require__(51531)); -var _helperValidatorIdentifier = __webpack_require__(86607); +var _helperValidatorIdentifier = __nccwpck_require__(86607); -var _chalk = _interopRequireDefault(__webpack_require__(38707)); +var _chalk = _interopRequireDefault(__nccwpck_require__(38707)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3321,12 +3468,12 @@ function highlight(code, options = {}) { /***/ }), /***/ 63803: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(35747); +const fs = __nccwpck_require__(35747); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, @@ -3368,14 +3515,14 @@ exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_B /***/ }), /***/ 75667: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async = __webpack_require__(84507); -const sync = __webpack_require__(69560); -const settings_1 = __webpack_require__(88662); +const async = __nccwpck_require__(84507); +const sync = __nccwpck_require__(69560); +const settings_1 = __nccwpck_require__(88662); exports.Settings = settings_1.default; function scandir(path, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -3400,15 +3547,15 @@ function getSettings(settingsOrOptions = {}) { /***/ }), /***/ 84507: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsStat = __webpack_require__(70109); -const rpl = __webpack_require__(75288); -const constants_1 = __webpack_require__(18838); -const utils = __webpack_require__(16297); +const fsStat = __nccwpck_require__(70109); +const rpl = __nccwpck_require__(75288); +const constants_1 = __nccwpck_require__(18838); +const utils = __nccwpck_require__(16297); function read(directory, settings, callback) { if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { return readdirWithFileTypes(directory, settings, callback); @@ -3498,14 +3645,14 @@ function callSuccessCallback(callback, result) { /***/ }), /***/ 69560: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsStat = __webpack_require__(70109); -const constants_1 = __webpack_require__(18838); -const utils = __webpack_require__(16297); +const fsStat = __nccwpck_require__(70109); +const constants_1 = __nccwpck_require__(18838); +const utils = __nccwpck_require__(16297); function read(directory, settings) { if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { return readdirWithFileTypes(directory, settings); @@ -3558,14 +3705,14 @@ exports.readdir = readdir; /***/ }), /***/ 88662: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const fsStat = __webpack_require__(70109); -const fs = __webpack_require__(63803); +const path = __nccwpck_require__(85622); +const fsStat = __nccwpck_require__(70109); +const fs = __nccwpck_require__(63803); class Settings { constructor(_options = {}) { this._options = _options; @@ -3616,24 +3763,24 @@ exports.createDirentFromStats = createDirentFromStats; /***/ }), /***/ 16297: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(60883); +const fs = __nccwpck_require__(60883); exports.fs = fs; /***/ }), /***/ 32987: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(35747); +const fs = __nccwpck_require__(35747); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, @@ -3652,14 +3799,14 @@ exports.createFileSystemAdapter = createFileSystemAdapter; /***/ }), /***/ 70109: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async = __webpack_require__(34147); -const sync = __webpack_require__(34527); -const settings_1 = __webpack_require__(12410); +const async = __nccwpck_require__(34147); +const sync = __nccwpck_require__(34527); +const settings_1 = __nccwpck_require__(12410); exports.Settings = settings_1.default; function stat(path, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -3753,12 +3900,12 @@ exports.read = read; /***/ }), /***/ 12410: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(32987); +const fs = __nccwpck_require__(32987); class Settings { constructor(_options = {}) { this._options = _options; @@ -3777,15 +3924,15 @@ exports.default = Settings; /***/ }), /***/ 26026: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async_1 = __webpack_require__(77523); -const stream_1 = __webpack_require__(96737); -const sync_1 = __webpack_require__(13068); -const settings_1 = __webpack_require__(50141); +const async_1 = __nccwpck_require__(77523); +const stream_1 = __nccwpck_require__(96737); +const sync_1 = __nccwpck_require__(13068); +const settings_1 = __nccwpck_require__(50141); exports.Settings = settings_1.default; function walk(directory, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { @@ -3817,12 +3964,12 @@ function getSettings(settingsOrOptions = {}) { /***/ }), /***/ 77523: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const async_1 = __webpack_require__(55732); +const async_1 = __nccwpck_require__(55732); class AsyncProvider { constructor(_root, _settings) { this._root = _root; @@ -3855,13 +4002,13 @@ function callSuccessCallback(callback, entries) { /***/ }), /***/ 96737: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __webpack_require__(92413); -const async_1 = __webpack_require__(55732); +const stream_1 = __nccwpck_require__(92413); +const async_1 = __nccwpck_require__(55732); class StreamProvider { constructor(_root, _settings) { this._root = _root; @@ -3893,12 +4040,12 @@ exports.default = StreamProvider; /***/ }), /***/ 13068: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const sync_1 = __webpack_require__(13595); +const sync_1 = __nccwpck_require__(13595); class SyncProvider { constructor(_root, _settings) { this._root = _root; @@ -3915,16 +4062,16 @@ exports.default = SyncProvider; /***/ }), /***/ 55732: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const events_1 = __webpack_require__(28614); -const fsScandir = __webpack_require__(75667); -const fastq = __webpack_require__(7340); -const common = __webpack_require__(97988); -const reader_1 = __webpack_require__(88311); +const events_1 = __nccwpck_require__(28614); +const fsScandir = __nccwpck_require__(75667); +const fastq = __nccwpck_require__(7340); +const common = __nccwpck_require__(97988); +const reader_1 = __nccwpck_require__(88311); class AsyncReader extends reader_1.default { constructor(_root, _settings) { super(_root, _settings); @@ -4048,12 +4195,12 @@ exports.joinPathSegments = joinPathSegments; /***/ }), /***/ 88311: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const common = __webpack_require__(97988); +const common = __nccwpck_require__(97988); class Reader { constructor(_root, _settings) { this._root = _root; @@ -4067,14 +4214,14 @@ exports.default = Reader; /***/ }), /***/ 13595: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsScandir = __webpack_require__(75667); -const common = __webpack_require__(97988); -const reader_1 = __webpack_require__(88311); +const fsScandir = __nccwpck_require__(75667); +const common = __nccwpck_require__(97988); +const reader_1 = __nccwpck_require__(88311); class SyncReader extends reader_1.default { constructor() { super(...arguments); @@ -4134,13 +4281,13 @@ exports.default = SyncReader; /***/ }), /***/ 50141: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const fsScandir = __webpack_require__(75667); +const path = __nccwpck_require__(85622); +const fsScandir = __nccwpck_require__(75667); class Settings { constructor(_options = {}) { this._options = _options; @@ -4225,18 +4372,18 @@ exports.createTokenAuth = createTokenAuth; /***/ }), /***/ 76762: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -var universalUserAgent = __webpack_require__(77540); -var beforeAfterHook = __webpack_require__(83682); -var request = __webpack_require__(36234); -var graphql = __webpack_require__(88467); -var authToken = __webpack_require__(40334); +var universalUserAgent = __nccwpck_require__(77540); +var beforeAfterHook = __nccwpck_require__(83682); +var request = __nccwpck_require__(36234); +var graphql = __nccwpck_require__(88467); +var authToken = __nccwpck_require__(40334); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; @@ -4433,7 +4580,7 @@ exports.getUserAgent = getUserAgent; /***/ }), /***/ 59440: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4442,8 +4589,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var isPlainObject = _interopDefault(__webpack_require__(48840)); -var universalUserAgent = __webpack_require__(45030); +var isPlainObject = _interopDefault(__nccwpck_require__(48840)); +var universalUserAgent = __nccwpck_require__(45030); function lowercaseKeys(object) { if (!object) { @@ -4820,15 +4967,15 @@ exports.endpoint = endpoint; /***/ }), /***/ 88467: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -var request = __webpack_require__(63758); -var universalUserAgent = __webpack_require__(45030); +var request = __nccwpck_require__(63758); +var universalUserAgent = __nccwpck_require__(45030); const VERSION = "4.5.0"; @@ -4913,7 +5060,7 @@ exports.withCustomRequest = withCustomRequest; /***/ }), /***/ 63758: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4922,11 +5069,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var endpoint = __webpack_require__(59440); -var universalUserAgent = __webpack_require__(45030); -var isPlainObject = _interopDefault(__webpack_require__(48840)); -var nodeFetch = _interopDefault(__webpack_require__(55655)); -var requestError = __webpack_require__(10537); +var endpoint = __nccwpck_require__(59440); +var universalUserAgent = __nccwpck_require__(45030); +var isPlainObject = _interopDefault(__nccwpck_require__(48840)); +var nodeFetch = _interopDefault(__nccwpck_require__(55655)); +var requestError = __nccwpck_require__(10537); const VERSION = "5.4.4"; @@ -5069,7 +5216,7 @@ exports.request = request; /***/ }), /***/ 55655: -/***/ ((module, exports, __webpack_require__) => { +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; @@ -5078,11 +5225,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var Stream = _interopDefault(__webpack_require__(92413)); -var http = _interopDefault(__webpack_require__(98605)); -var Url = _interopDefault(__webpack_require__(78835)); -var https = _interopDefault(__webpack_require__(57211)); -var zlib = _interopDefault(__webpack_require__(78761)); +var Stream = _interopDefault(__nccwpck_require__(92413)); +var http = _interopDefault(__nccwpck_require__(98605)); +var Url = _interopDefault(__nccwpck_require__(78835)); +var https = _interopDefault(__nccwpck_require__(57211)); +var zlib = _interopDefault(__nccwpck_require__(78761)); // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js @@ -5233,7 +5380,7 @@ FetchError.prototype.name = 'FetchError'; let convert; try { - convert = __webpack_require__(85100)/* .convert */ .O; + convert = __nccwpck_require__(85100)/* .convert */ .O; } catch (e) {} const INTERNALS = Symbol('Body internals'); @@ -8021,7 +8168,7 @@ exports.restEndpointMethods = restEndpointMethods; /***/ }), /***/ 10537: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8030,8 +8177,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var deprecation = __webpack_require__(58932); -var once = _interopDefault(__webpack_require__(1223)); +var deprecation = __nccwpck_require__(58932); +var once = _interopDefault(__nccwpck_require__(1223)); const logOnce = once(deprecation => console.warn(deprecation)); /** @@ -8084,7 +8231,7 @@ exports.RequestError = RequestError; /***/ }), /***/ 36234: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8093,11 +8240,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var endpoint = __webpack_require__(59440); -var universalUserAgent = __webpack_require__(41441); -var isPlainObject = __webpack_require__(49062); -var nodeFetch = _interopDefault(__webpack_require__(80467)); -var requestError = __webpack_require__(30013); +var endpoint = __nccwpck_require__(59440); +var universalUserAgent = __nccwpck_require__(41441); +var isPlainObject = __nccwpck_require__(49062); +var nodeFetch = _interopDefault(__nccwpck_require__(80467)); +var requestError = __nccwpck_require__(30013); const VERSION = "5.4.10"; @@ -8240,7 +8387,7 @@ exports.request = request; /***/ }), /***/ 30013: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8249,8 +8396,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var deprecation = __webpack_require__(58932); -var once = _interopDefault(__webpack_require__(1223)); +var deprecation = __nccwpck_require__(58932); +var once = _interopDefault(__nccwpck_require__(1223)); const logOnce = once(deprecation => console.warn(deprecation)); /** @@ -8375,12 +8522,12 @@ exports.getUserAgent = getUserAgent; /***/ }), /***/ 52068: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); +/* module decorator */ module = __nccwpck_require__.nmd(module); -const colorConvert = __webpack_require__(86931); +const colorConvert = __nccwpck_require__(86931); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -8629,11 +8776,11 @@ function range(a, b, str) { /***/ }), /***/ 83682: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var register = __webpack_require__(44670) -var addHook = __webpack_require__(5549) -var removeHook = __webpack_require__(6819) +var register = __nccwpck_require__(44670) +var addHook = __nccwpck_require__(5549) +var removeHook = __nccwpck_require__(6819) // bind with array of arguments: https://stackoverflow.com/a/21792913 var bind = Function.bind @@ -8805,10 +8952,10 @@ function removeHook (state, name, method) { /***/ }), /***/ 33717: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var concatMap = __webpack_require__(86891); -var balanced = __webpack_require__(9417); +var concatMap = __nccwpck_require__(86891); +var balanced = __nccwpck_require__(9417); module.exports = expandTop; @@ -9013,15 +9160,15 @@ function expand(str, isTop) { /***/ }), /***/ 50610: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const stringify = __webpack_require__(38750); -const compile = __webpack_require__(79434); -const expand = __webpack_require__(35873); -const parse = __webpack_require__(96477); +const stringify = __nccwpck_require__(38750); +const compile = __nccwpck_require__(79434); +const expand = __nccwpck_require__(35873); +const parse = __nccwpck_require__(96477); /** * Expand the given pattern or create a regex-compatible string. @@ -9191,13 +9338,13 @@ module.exports = braces; /***/ }), /***/ 79434: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fill = __webpack_require__(6330); -const utils = __webpack_require__(45207); +const fill = __nccwpck_require__(6330); +const utils = __nccwpck_require__(45207); const compile = (ast, options = {}) => { let walk = (node, parent = {}) => { @@ -9321,14 +9468,14 @@ module.exports = { /***/ }), /***/ 35873: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fill = __webpack_require__(6330); -const stringify = __webpack_require__(38750); -const utils = __webpack_require__(45207); +const fill = __nccwpck_require__(6330); +const stringify = __nccwpck_require__(38750); +const utils = __nccwpck_require__(45207); const append = (queue = '', stash = '', enclose = false) => { let result = []; @@ -9442,12 +9589,12 @@ module.exports = expand; /***/ }), /***/ 96477: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const stringify = __webpack_require__(38750); +const stringify = __nccwpck_require__(38750); /** * Constants @@ -9469,7 +9616,7 @@ const { CHAR_SINGLE_QUOTE, /* ' */ CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = __webpack_require__(18774); +} = __nccwpck_require__(18774); /** * parse @@ -9783,12 +9930,12 @@ module.exports = parse; /***/ }), /***/ 38750: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const utils = __webpack_require__(45207); +const utils = __nccwpck_require__(45207); module.exports = (ast, options = {}) => { let stringify = (node, parent = {}) => { @@ -9943,15 +10090,15 @@ exports.flatten = (...args) => { /***/ }), /***/ 38707: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const escapeStringRegexp = __webpack_require__(98691); -const ansiStyles = __webpack_require__(52068); -const stdoutColor = __webpack_require__(59318).stdout; +const escapeStringRegexp = __nccwpck_require__(98691); +const ansiStyles = __nccwpck_require__(52068); +const stdoutColor = __nccwpck_require__(59318).stdout; -const template = __webpack_require__(52138); +const template = __nccwpck_require__(52138); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -10315,10 +10462,10 @@ module.exports = (chalk, tmp) => { /***/ }), /***/ 97391: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* MIT license */ -var cssKeywords = __webpack_require__(78510); +var cssKeywords = __nccwpck_require__(78510); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). @@ -11190,10 +11337,10 @@ convert.rgb.gray = function (rgb) { /***/ }), /***/ 86931: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var conversions = __webpack_require__(97391); -var route = __webpack_require__(30880); +var conversions = __nccwpck_require__(97391); +var route = __nccwpck_require__(30880); var convert = {}; @@ -11275,9 +11422,9 @@ module.exports = convert; /***/ }), /***/ 30880: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var conversions = __webpack_require__(97391); +var conversions = __nccwpck_require__(97391); /* this function routes a model to all other models. @@ -11559,14 +11706,14 @@ var isArray = Array.isArray || function (xs) { /***/ }), /***/ 72746: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const cp = __webpack_require__(63129); -const parse = __webpack_require__(66855); -const enoent = __webpack_require__(44101); +const cp = __nccwpck_require__(63129); +const parse = __nccwpck_require__(66855); +const enoent = __nccwpck_require__(44101); function spawn(command, args, options) { // Parse the arguments @@ -11673,15 +11820,15 @@ module.exports = { /***/ }), /***/ 66855: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const resolveCommand = __webpack_require__(87274); -const escape = __webpack_require__(34274); -const readShebang = __webpack_require__(41252); +const path = __nccwpck_require__(85622); +const resolveCommand = __nccwpck_require__(87274); +const escape = __nccwpck_require__(34274); +const readShebang = __nccwpck_require__(41252); const isWin = process.platform === 'win32'; const isExecutableRegExp = /\.(?:com|exe)$/i; @@ -11825,13 +11972,13 @@ module.exports.argument = escapeArgument; /***/ }), /***/ 41252: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const shebangCommand = __webpack_require__(67032); +const fs = __nccwpck_require__(35747); +const shebangCommand = __nccwpck_require__(67032); function readShebang(command) { // Read the first 150 bytes from the file @@ -11856,14 +12003,14 @@ module.exports = readShebang; /***/ }), /***/ 87274: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const which = __webpack_require__(34207); -const getPathKey = __webpack_require__(29060); +const path = __nccwpck_require__(85622); +const which = __nccwpck_require__(34207); +const getPathKey = __nccwpck_require__(29060); function resolveCommandAttempt(parsed, withoutPathExt) { const env = parsed.options.env || process.env; @@ -11968,12 +12115,12 @@ exports.Deprecation = Deprecation; /***/ }), /***/ 12738: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const pathType = __webpack_require__(63433); +const path = __nccwpck_require__(85622); +const pathType = __nccwpck_require__(63433); const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; @@ -12051,9 +12198,9 @@ module.exports.sync = (input, options) => { /***/ }), /***/ 81205: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var once = __webpack_require__(1223); +var once = __nccwpck_require__(1223); var noop = function() {}; @@ -12152,13 +12299,13 @@ module.exports = eos; /***/ }), /***/ 23505: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var util = __webpack_require__(31669); -var isArrayish = __webpack_require__(7604); +var util = __nccwpck_require__(31669); +var isArrayish = __nccwpck_require__(7604); var errorEx = function errorEx(name, properties) { if (!name || name.constructor !== String) { @@ -12320,22 +12467,22 @@ module.exports = function (str) { /***/ }), /***/ 55447: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const childProcess = __webpack_require__(63129); -const crossSpawn = __webpack_require__(72746); -const stripFinalNewline = __webpack_require__(88174); -const npmRunPath = __webpack_require__(20502); -const onetime = __webpack_require__(89082); -const makeError = __webpack_require__(62187); -const normalizeStdio = __webpack_require__(10166); -const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(39819); -const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(32592); -const {mergePromise, getSpawnedPromise} = __webpack_require__(97814); -const {joinCommand, parseCommand} = __webpack_require__(88286); +const path = __nccwpck_require__(85622); +const childProcess = __nccwpck_require__(63129); +const crossSpawn = __nccwpck_require__(72746); +const stripFinalNewline = __nccwpck_require__(88174); +const npmRunPath = __nccwpck_require__(20502); +const onetime = __nccwpck_require__(89082); +const makeError = __nccwpck_require__(62187); +const normalizeStdio = __nccwpck_require__(10166); +const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __nccwpck_require__(39819); +const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __nccwpck_require__(32592); +const {mergePromise, getSpawnedPromise} = __nccwpck_require__(97814); +const {joinCommand, parseCommand} = __nccwpck_require__(88286); const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; @@ -12472,8 +12619,6 @@ const execa = (file, args, options) => { const handlePromiseOnce = onetime(handlePromise); - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - handleInput(spawned, parsed.options.input); spawned.all = makeAllStream(spawned, parsed.options); @@ -12628,11 +12773,11 @@ module.exports = { /***/ }), /***/ 62187: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {signalsByName} = __webpack_require__(2779); +const {signalsByName} = __nccwpck_require__(2779); const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { if (timedOut) { @@ -12722,12 +12867,12 @@ module.exports = makeError; /***/ }), /***/ 39819: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const onExit = __webpack_require__(24931); +const os = __nccwpck_require__(12087); +const onExit = __nccwpck_require__(24931); const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; @@ -12902,20 +13047,20 @@ module.exports = { const aliases = ['stdin', 'stdout', 'stderr']; -const hasAlias = opts => aliases.some(alias => opts[alias] !== undefined); +const hasAlias = options => aliases.some(alias => options[alias] !== undefined); -const normalizeStdio = opts => { - if (!opts) { +const normalizeStdio = options => { + if (!options) { return; } - const {stdio} = opts; + const {stdio} = options; if (stdio === undefined) { - return aliases.map(alias => opts[alias]); + return aliases.map(alias => options[alias]); } - if (hasAlias(opts)) { + if (hasAlias(options)) { throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); } @@ -12934,8 +13079,8 @@ const normalizeStdio = opts => { module.exports = normalizeStdio; // `ipc` is pushed unless it is already present -module.exports.node = opts => { - const stdio = normalizeStdio(opts); +module.exports.node = options => { + const stdio = normalizeStdio(options); if (stdio === 'ipc') { return 'ipc'; @@ -12956,13 +13101,13 @@ module.exports.node = opts => { /***/ }), /***/ 32592: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const isStream = __webpack_require__(41554); -const getStream = __webpack_require__(21766); -const mergeStream = __webpack_require__(2621); +const isStream = __nccwpck_require__(41554); +const getStream = __nccwpck_require__(21766); +const mergeStream = __nccwpck_require__(2621); // `input` option const handleInput = (spawned, input) => { @@ -13061,16 +13206,16 @@ module.exports = { /***/ }), /***/ 43664: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const taskManager = __webpack_require__(42708); -const async_1 = __webpack_require__(95679); -const stream_1 = __webpack_require__(94630); -const sync_1 = __webpack_require__(42405); -const settings_1 = __webpack_require__(10952); -const utils = __webpack_require__(45444); +const taskManager = __nccwpck_require__(42708); +const async_1 = __nccwpck_require__(95679); +const stream_1 = __nccwpck_require__(94630); +const sync_1 = __nccwpck_require__(42405); +const settings_1 = __nccwpck_require__(10952); +const utils = __nccwpck_require__(45444); async function FastGlob(source, options) { assertPatternsInput(source); const works = getWorks(source, async_1.default, options); @@ -13136,12 +13281,12 @@ module.exports = FastGlob; /***/ }), /***/ 42708: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); function generate(patterns, settings) { const positivePatterns = getPositivePatterns(patterns); const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); @@ -13208,13 +13353,13 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ }), /***/ 95679: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __webpack_require__(12083); -const provider_1 = __webpack_require__(60257); +const stream_1 = __nccwpck_require__(12083); +const provider_1 = __nccwpck_require__(60257); class ProviderAsync extends provider_1.default { constructor() { super(...arguments); @@ -13244,13 +13389,13 @@ exports.default = ProviderAsync; /***/ }), /***/ 36983: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); -const partial_1 = __webpack_require__(35295); +const utils = __nccwpck_require__(45444); +const partial_1 = __nccwpck_require__(35295); class DeepFilter { constructor(_settings, _micromatchOptions) { this._settings = _settings; @@ -13306,12 +13451,12 @@ exports.default = DeepFilter; /***/ }), /***/ 71343: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); class EntryFilter { constructor(_settings, _micromatchOptions) { this._settings = _settings; @@ -13369,12 +13514,12 @@ exports.default = EntryFilter; /***/ }), /***/ 36654: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); class ErrorFilter { constructor(_settings) { this._settings = _settings; @@ -13392,12 +13537,12 @@ exports.default = ErrorFilter; /***/ }), /***/ 32576: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); class Matcher { constructor(_patterns, _settings, _micromatchOptions) { this._patterns = _patterns; @@ -13450,12 +13595,12 @@ exports.default = Matcher; /***/ }), /***/ 35295: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const matcher_1 = __webpack_require__(32576); +const matcher_1 = __nccwpck_require__(32576); class PartialMatcher extends matcher_1.default { match(filepath) { const parts = filepath.split('/'); @@ -13496,16 +13641,16 @@ exports.default = PartialMatcher; /***/ }), /***/ 60257: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const deep_1 = __webpack_require__(36983); -const entry_1 = __webpack_require__(71343); -const error_1 = __webpack_require__(36654); -const entry_2 = __webpack_require__(94029); +const path = __nccwpck_require__(85622); +const deep_1 = __nccwpck_require__(36983); +const entry_1 = __nccwpck_require__(71343); +const error_1 = __nccwpck_require__(36654); +const entry_2 = __nccwpck_require__(94029); class Provider { constructor(_settings) { this._settings = _settings; @@ -13552,14 +13697,14 @@ exports.default = Provider; /***/ }), /***/ 94630: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __webpack_require__(92413); -const stream_2 = __webpack_require__(12083); -const provider_1 = __webpack_require__(60257); +const stream_1 = __nccwpck_require__(92413); +const stream_2 = __nccwpck_require__(12083); +const provider_1 = __nccwpck_require__(60257); class ProviderStream extends provider_1.default { constructor() { super(...arguments); @@ -13591,13 +13736,13 @@ exports.default = ProviderStream; /***/ }), /***/ 42405: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const sync_1 = __webpack_require__(76234); -const provider_1 = __webpack_require__(60257); +const sync_1 = __nccwpck_require__(76234); +const provider_1 = __nccwpck_require__(60257); class ProviderSync extends provider_1.default { constructor() { super(...arguments); @@ -13622,12 +13767,12 @@ exports.default = ProviderSync; /***/ }), /***/ 94029: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __webpack_require__(45444); +const utils = __nccwpck_require__(45444); class EntryTransformer { constructor(_settings) { this._settings = _settings; @@ -13656,14 +13801,14 @@ exports.default = EntryTransformer; /***/ }), /***/ 65582: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const fsStat = __webpack_require__(70109); -const utils = __webpack_require__(45444); +const path = __nccwpck_require__(85622); +const fsStat = __nccwpck_require__(70109); +const utils = __nccwpck_require__(45444); class Reader { constructor(_settings) { this._settings = _settings; @@ -13697,15 +13842,15 @@ exports.default = Reader; /***/ }), /***/ 12083: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __webpack_require__(92413); -const fsStat = __webpack_require__(70109); -const fsWalk = __webpack_require__(26026); -const reader_1 = __webpack_require__(65582); +const stream_1 = __nccwpck_require__(92413); +const fsStat = __nccwpck_require__(70109); +const fsWalk = __nccwpck_require__(26026); +const reader_1 = __nccwpck_require__(65582); class ReaderStream extends reader_1.default { constructor() { super(...arguments); @@ -13760,14 +13905,14 @@ exports.default = ReaderStream; /***/ }), /***/ 76234: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsStat = __webpack_require__(70109); -const fsWalk = __webpack_require__(26026); -const reader_1 = __webpack_require__(65582); +const fsStat = __nccwpck_require__(70109); +const fsWalk = __nccwpck_require__(26026); +const reader_1 = __nccwpck_require__(65582); class ReaderSync extends reader_1.default { constructor() { super(...arguments); @@ -13811,13 +13956,13 @@ exports.default = ReaderSync; /***/ }), /***/ 10952: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(35747); -const os = __webpack_require__(12087); +const fs = __nccwpck_require__(35747); +const os = __nccwpck_require__(12087); const CPU_COUNT = os.cpus().length; exports.DEFAULT_FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, @@ -13940,36 +14085,36 @@ exports.createDirentFromStats = createDirentFromStats; /***/ }), /***/ 45444: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const array = __webpack_require__(85325); +const array = __nccwpck_require__(85325); exports.array = array; -const errno = __webpack_require__(41230); +const errno = __nccwpck_require__(41230); exports.errno = errno; -const fs = __webpack_require__(17543); +const fs = __nccwpck_require__(17543); exports.fs = fs; -const path = __webpack_require__(63873); +const path = __nccwpck_require__(63873); exports.path = path; -const pattern = __webpack_require__(81221); +const pattern = __nccwpck_require__(81221); exports.pattern = pattern; -const stream = __webpack_require__(18382); +const stream = __nccwpck_require__(18382); exports.stream = stream; -const string = __webpack_require__(52203); +const string = __nccwpck_require__(52203); exports.string = string; /***/ }), /***/ 63873: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); +const path = __nccwpck_require__(85622); const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; /** @@ -14004,15 +14149,15 @@ exports.removeLeadingDotSegment = removeLeadingDotSegment; /***/ }), /***/ 81221: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __webpack_require__(85622); -const globParent = __webpack_require__(54655); -const micromatch = __webpack_require__(76228); -const picomatch = __webpack_require__(78569); +const path = __nccwpck_require__(85622); +const globParent = __nccwpck_require__(54655); +const micromatch = __nccwpck_require__(76228); +const picomatch = __nccwpck_require__(78569); const GLOBSTAR = '**'; const ESCAPE_SYMBOL = '\\'; const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; @@ -14124,12 +14269,12 @@ exports.matchAny = matchAny; /***/ }), /***/ 18382: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const merge2 = __webpack_require__(82578); +const merge2 = __nccwpck_require__(82578); function merge(streams) { const mergedStream = merge2(streams); streams.forEach((stream) => { @@ -14166,12 +14311,12 @@ exports.isEmpty = isEmpty; /***/ }), /***/ 7340: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var reusify = __webpack_require__(32113) +var reusify = __nccwpck_require__(32113) function fastqueue (context, worker, concurrency) { if (typeof context === 'function') { @@ -14360,7 +14505,7 @@ module.exports = fastqueue /***/ }), /***/ 6330: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /*! @@ -14372,8 +14517,8 @@ module.exports = fastqueue -const util = __webpack_require__(31669); -const toRegexRange = __webpack_require__(1861); +const util = __nccwpck_require__(31669); +const toRegexRange = __nccwpck_require__(1861); const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); @@ -14617,13 +14762,13 @@ module.exports = fill; /***/ }), /***/ 9486: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const locatePath = __webpack_require__(63447); -const pathExists = __webpack_require__(96978); +const path = __nccwpck_require__(85622); +const locatePath = __nccwpck_require__(63447); +const pathExists = __nccwpck_require__(96978); const stop = Symbol('findUp.stop'); @@ -14714,7 +14859,7 @@ module.exports.stop = stop; /***/ }), /***/ 46863: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = realpath realpath.realpath = realpath @@ -14723,13 +14868,13 @@ realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch -var fs = __webpack_require__(35747) +var fs = __nccwpck_require__(35747) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(71734) +var old = __nccwpck_require__(71734) function newError (er) { return er && er.syscall === 'realpath' && ( @@ -14787,7 +14932,7 @@ function unmonkeypatch () { /***/ }), /***/ 71734: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { // Copyright Joyent, Inc. and other Node contributors. // @@ -14810,9 +14955,9 @@ function unmonkeypatch () { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -var pathModule = __webpack_require__(85622); +var pathModule = __nccwpck_require__(85622); var isWindows = process.platform === 'win32'; -var fs = __webpack_require__(35747); +var fs = __nccwpck_require__(35747); // JavaScript implementation of realpath, ported from node pre-v6 @@ -15157,12 +15302,12 @@ module.exports = function bind(that) { /***/ }), /***/ 88334: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var implementation = __webpack_require__(19320); +var implementation = __nccwpck_require__(19320); module.exports = Function.prototype.bind || implementation; @@ -15170,11 +15315,11 @@ module.exports = Function.prototype.bind || implementation; /***/ }), /***/ 91585: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {PassThrough: PassThroughStream} = __webpack_require__(92413); +const {PassThrough: PassThroughStream} = __nccwpck_require__(92413); module.exports = options => { options = {...options}; @@ -15230,12 +15375,16 @@ module.exports = options => { /***/ }), /***/ 21766: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pump = __webpack_require__(18341); -const bufferStream = __webpack_require__(91585); +const {constants: BufferConstants} = __nccwpck_require__(64293); +const stream = __nccwpck_require__(92413); +const {promisify} = __nccwpck_require__(31669); +const bufferStream = __nccwpck_require__(91585); + +const streamPipelinePromisified = promisify(stream.pipeline); class MaxBufferError extends Error { constructor() { @@ -15246,7 +15395,7 @@ class MaxBufferError extends Error { async function getStream(inputStream, options) { if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); + throw new Error('Expected a stream'); } options = { @@ -15255,25 +15404,26 @@ async function getStream(inputStream, options) { }; const {maxBuffer} = options; + const stream = bufferStream(options); - let stream; await new Promise((resolve, reject) => { const rejectPromise = error => { - if (error) { // A null check + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { error.bufferedData = stream.getBufferedValue(); } reject(error); }; - stream = pump(inputStream, bufferStream(options), error => { - if (error) { + (async () => { + try { + await streamPipelinePromisified(inputStream, stream); + resolve(); + } catch (error) { rejectPromise(error); - return; } - - resolve(); - }); + })(); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { @@ -15286,8 +15436,6 @@ async function getStream(inputStream, options) { } module.exports = getStream; -// TODO: Remove this for the next major release -module.exports.default = getStream; module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); module.exports.MaxBufferError = MaxBufferError; @@ -15296,14 +15444,14 @@ module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 54655: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var isGlob = __webpack_require__(34466); -var pathPosixDirname = __webpack_require__(85622).posix.dirname; -var isWin32 = __webpack_require__(12087).platform() === 'win32'; +var isGlob = __nccwpck_require__(34466); +var pathPosixDirname = __nccwpck_require__(85622).posix.dirname; +var isWin32 = __nccwpck_require__(12087).platform() === 'win32'; var slash = '/'; var backslash = /\\/g; @@ -15345,7 +15493,7 @@ module.exports = function globParent(str, opts) { /***/ }), /***/ 47625: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { exports.alphasort = alphasort exports.alphasorti = alphasorti @@ -15361,9 +15509,9 @@ function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } -var path = __webpack_require__(85622) -var minimatch = __webpack_require__(83973) -var isAbsolute = __webpack_require__(38714) +var path = __nccwpck_require__(85622) +var minimatch = __nccwpck_require__(83973) +var isAbsolute = __nccwpck_require__(38714) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { @@ -15592,7 +15740,7 @@ function childrenIgnored (self, path) { /***/ }), /***/ 91957: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Approach: // @@ -15636,27 +15784,27 @@ function childrenIgnored (self, path) { module.exports = glob -var fs = __webpack_require__(35747) -var rp = __webpack_require__(46863) -var minimatch = __webpack_require__(83973) +var fs = __nccwpck_require__(35747) +var rp = __nccwpck_require__(46863) +var minimatch = __nccwpck_require__(83973) var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(44124) -var EE = __webpack_require__(28614).EventEmitter -var path = __webpack_require__(85622) -var assert = __webpack_require__(42357) -var isAbsolute = __webpack_require__(38714) -var globSync = __webpack_require__(29010) -var common = __webpack_require__(47625) +var inherits = __nccwpck_require__(44124) +var EE = __nccwpck_require__(28614).EventEmitter +var path = __nccwpck_require__(85622) +var assert = __nccwpck_require__(42357) +var isAbsolute = __nccwpck_require__(38714) +var globSync = __nccwpck_require__(29010) +var common = __nccwpck_require__(47625) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp -var inflight = __webpack_require__(52492) -var util = __webpack_require__(31669) +var inflight = __nccwpck_require__(52492) +var util = __nccwpck_require__(31669) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored -var once = __webpack_require__(1223) +var once = __nccwpck_require__(1223) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} @@ -16389,21 +16537,21 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { /***/ }), /***/ 29010: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = globSync globSync.GlobSync = GlobSync -var fs = __webpack_require__(35747) -var rp = __webpack_require__(46863) -var minimatch = __webpack_require__(83973) +var fs = __nccwpck_require__(35747) +var rp = __nccwpck_require__(46863) +var minimatch = __nccwpck_require__(83973) var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__(91957).Glob -var util = __webpack_require__(31669) -var path = __webpack_require__(85622) -var assert = __webpack_require__(42357) -var isAbsolute = __webpack_require__(38714) -var common = __webpack_require__(47625) +var Glob = __nccwpck_require__(91957).Glob +var util = __nccwpck_require__(31669) +var path = __nccwpck_require__(85622) +var assert = __nccwpck_require__(42357) +var isAbsolute = __nccwpck_require__(38714) +var common = __nccwpck_require__(47625) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts @@ -16882,16 +17030,16 @@ GlobSync.prototype._makeAbs = function (f) { /***/ }), /***/ 89038: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {promisify} = __webpack_require__(31669); -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const fastGlob = __webpack_require__(43664); -const gitIgnore = __webpack_require__(91230); -const slash = __webpack_require__(97543); +const {promisify} = __nccwpck_require__(31669); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const fastGlob = __nccwpck_require__(43664); +const gitIgnore = __nccwpck_require__(91230); +const slash = __nccwpck_require__(97543); const DEFAULT_IGNORE = [ '**/node_modules/**', @@ -16921,13 +17069,15 @@ const parseGitIgnore = (content, options) => { }; const reduceIgnore = files => { - return files.reduce((ignores, file) => { + const ignores = gitIgnore(); + for (const file of files) { ignores.add(parseGitIgnore(file.content, { cwd: file.cwd, fileName: file.filePath })); - return ignores; - }, gitIgnore()); + } + + return ignores; }; const ensureAbsolutePathForCwd = (cwd, p) => { @@ -16944,7 +17094,7 @@ const ensureAbsolutePathForCwd = (cwd, p) => { }; const getIsIgnoredPredecate = (ignores, cwd) => { - return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p)))); + return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p.path || p)))); }; const getFile = async (file, cwd) => { @@ -17008,17 +17158,17 @@ module.exports.sync = options => { /***/ }), /***/ 43398: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const arrayUnion = __webpack_require__(99600); -const merge2 = __webpack_require__(82578); -const fastGlob = __webpack_require__(43664); -const dirGlob = __webpack_require__(12738); -const gitignore = __webpack_require__(89038); -const {FilterStream, UniqueStream} = __webpack_require__(32408); +const fs = __nccwpck_require__(35747); +const arrayUnion = __nccwpck_require__(99600); +const merge2 = __nccwpck_require__(82578); +const fastGlob = __nccwpck_require__(43664); +const dirGlob = __nccwpck_require__(12738); +const gitignore = __nccwpck_require__(89038); +const {FilterStream, UniqueStream} = __nccwpck_require__(32408); const DEFAULT_FILTER = () => false; @@ -17038,7 +17188,7 @@ const checkCwdOption = (options = {}) => { let stat; try { stat = fs.statSync(options.cwd); - } catch (_) { + } catch { return; } @@ -17069,7 +17219,7 @@ const generateGlobTasks = (patterns, taskOptions) => { const ignore = patterns .slice(index) - .filter(isNegative) + .filter(pattern => isNegative(pattern)) .map(pattern => pattern.slice(1)); const options = { @@ -17151,26 +17301,30 @@ module.exports = async (patterns, options) => { module.exports.sync = (patterns, options) => { const globTasks = generateGlobTasks(patterns, options); - const tasks = globTasks.reduce((tasks, task) => { + const tasks = []; + for (const task of globTasks) { const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - return tasks.concat(newTask); - }, []); + tasks.push(...newTask); + } const filter = getFilterSync(options); - return tasks.reduce( - (matches, task) => arrayUnion(matches, fastGlob.sync(task.pattern, task.options)), - [] - ).filter(path_ => !filter(path_)); + let matches = []; + for (const task of tasks) { + matches = arrayUnion(matches, fastGlob.sync(task.pattern, task.options)); + } + + return matches.filter(path_ => !filter(path_)); }; module.exports.stream = (patterns, options) => { const globTasks = generateGlobTasks(patterns, options); - const tasks = globTasks.reduce((tasks, task) => { + const tasks = []; + for (const task of globTasks) { const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - return tasks.concat(newTask); - }, []); + tasks.push(...newTask); + } const filter = getFilterSync(options); const filterStream = new FilterStream(p => !filter(p)); @@ -17193,11 +17347,11 @@ module.exports.gitignore = gitignore; /***/ }), /***/ 32408: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {Transform} = __webpack_require__(92413); +const {Transform} = __nccwpck_require__(92413); class ObjectTransform extends Transform { constructor() { @@ -17263,12 +17417,12 @@ module.exports = (flag, argv) => { /***/ }), /***/ 76339: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var bind = __webpack_require__(88334); +var bind = __nccwpck_require__(88334); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); @@ -17363,11 +17517,11 @@ function formatHashFragment (fragment) { /***/ }), /***/ 18145: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var gitHosts = __webpack_require__(30135) +var gitHosts = __nccwpck_require__(30135) /* eslint-disable node/no-deprecated-api */ // copy-pasta util._extend from node's source, to avoid pulling @@ -17527,13 +17681,13 @@ GitHost.prototype.toString = function (opts) { /***/ }), /***/ 88869: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var url = __webpack_require__(78835) -var gitHosts = __webpack_require__(30135) -var GitHost = module.exports = __webpack_require__(18145) +var url = __nccwpck_require__(78835) +var gitHosts = __nccwpck_require__(30135) +var GitHost = module.exports = __nccwpck_require__(18145) var protocolToRepresentationMap = { 'git+ssh:': 'sshurl', @@ -17963,13 +18117,13 @@ standard:"other"}];exports.SIGNALS=SIGNALS; /***/ }), /***/ 2779: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(12087); +Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__nccwpck_require__(12087); -var _signals=__webpack_require__(86435); -var _realtime=__webpack_require__(25295); +var _signals=__nccwpck_require__(86435); +var _realtime=__nccwpck_require__(25295); @@ -18067,13 +18221,13 @@ const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; /***/ }), /***/ 86435: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__webpack_require__(12087); +Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__nccwpck_require__(12087); -var _core=__webpack_require__(28213); -var _realtime=__webpack_require__(25295); +var _core=__nccwpck_require__(28213); +var _realtime=__nccwpck_require__(25295); @@ -18713,11 +18867,11 @@ if ( /***/ }), /***/ 52492: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var wrappy = __webpack_require__(62940) +var wrappy = __nccwpck_require__(62940) var reqs = Object.create(null) -var once = __webpack_require__(1223) +var once = __nccwpck_require__(1223) module.exports = wrappy(inflight) @@ -18774,16 +18928,16 @@ function slice (args) { /***/ }), /***/ 44124: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { try { - var util = __webpack_require__(31669); + var util = __nccwpck_require__(31669); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ - module.exports = __webpack_require__(8544); + module.exports = __nccwpck_require__(8544); } @@ -18842,12 +18996,12 @@ module.exports = function isArrayish(obj) { /***/ }), /***/ 56873: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var has = __webpack_require__(76339); +var has = __nccwpck_require__(76339); function specifierIncluded(current, specifier) { var nodeParts = current.split('.'); @@ -18909,7 +19063,7 @@ function versionIncluded(nodeVersion, specifierValue) { return matchesRange(current, specifierValue); } -var data = __webpack_require__(93991); +var data = __nccwpck_require__(93991); module.exports = function isCore(x, nodeVersion) { return has(data, x) && versionIncluded(nodeVersion, data[x]); @@ -18946,7 +19100,7 @@ module.exports = function isExtglob(str) { /***/ }), /***/ 34466: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! * is-glob @@ -18955,7 +19109,7 @@ module.exports = function isExtglob(str) { * Released under the MIT License. */ -var isExtglob = __webpack_require__(76435); +var isExtglob = __nccwpck_require__(76435); var chars = { '{': '}', '(': ')', '[': ']'}; var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; @@ -19120,14 +19274,14 @@ module.exports = isStream; /***/ }), /***/ 97126: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __webpack_require__(35747) +var fs = __nccwpck_require__(35747) var core if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = __webpack_require__(42001) + core = __nccwpck_require__(42001) } else { - core = __webpack_require__(9728) + core = __nccwpck_require__(9728) } module.exports = isexe @@ -19184,12 +19338,12 @@ function sync (path, options) { /***/ }), /***/ 9728: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = isexe isexe.sync = sync -var fs = __webpack_require__(35747) +var fs = __nccwpck_require__(35747) function isexe (path, options, cb) { fs.stat(path, function (er, stat) { @@ -19232,12 +19386,12 @@ function checkMode (stat, options) { /***/ }), /***/ 42001: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = isexe isexe.sync = sync -var fs = __webpack_require__(35747) +var fs = __nccwpck_require__(35747) function checkPathExt (path, options) { var pathext = options.pathExt !== undefined ? @@ -19423,14 +19577,14 @@ exports.default = LinesAndColumns; /***/ }), /***/ 63447: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const {promisify} = __webpack_require__(31669); -const pLocate = __webpack_require__(90104); +const path = __nccwpck_require__(85622); +const fs = __nccwpck_require__(35747); +const {promisify} = __nccwpck_require__(31669); +const pLocate = __nccwpck_require__(90104); const fsStat = promisify(fs.stat); const fsLStat = promisify(fs.lstat); @@ -19496,11 +19650,11 @@ module.exports.sync = (paths, options) => { /***/ }), /***/ 7493: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); +const os = __nccwpck_require__(12087); const nameMap = new Map([ [19, 'Catalina'], @@ -19536,12 +19690,12 @@ module.exports.default = macosRelease; /***/ }), /***/ 2621: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { PassThrough } = __webpack_require__(92413); +const { PassThrough } = __nccwpck_require__(92413); module.exports = function (/*streams...*/) { var sources = [] @@ -19585,7 +19739,7 @@ module.exports = function (/*streams...*/) { /***/ }), /***/ 82578: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -19596,7 +19750,7 @@ module.exports = function (/*streams...*/) { * Copyright (c) 2014-2020 Teambition * Licensed under the MIT license. */ -const Stream = __webpack_require__(92413) +const Stream = __nccwpck_require__(92413) const PassThrough = Stream.PassThrough const slice = Array.prototype.slice @@ -19737,15 +19891,15 @@ function pauseStreams (streams, options) { /***/ }), /***/ 76228: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __webpack_require__(31669); -const braces = __webpack_require__(50610); -const picomatch = __webpack_require__(78569); -const utils = __webpack_require__(30479); +const util = __nccwpck_require__(31669); +const braces = __nccwpck_require__(50610); +const picomatch = __nccwpck_require__(78569); +const utils = __nccwpck_require__(30479); const isEmptyString = val => typeof val === 'string' && (val === '' || val === './'); /** @@ -20233,18 +20387,18 @@ module.exports.default = mimicFn; /***/ }), /***/ 83973: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = minimatch minimatch.Minimatch = Minimatch var path = { sep: '/' } try { - path = __webpack_require__(85622) + path = __nccwpck_require__(85622) } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(33717) +var expand = __nccwpck_require__(33717) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, @@ -21182,7 +21336,7 @@ module.exports = function(fn) { /***/ }), /***/ 80467: -/***/ ((module, exports, __webpack_require__) => { +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; @@ -21191,11 +21345,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var Stream = _interopDefault(__webpack_require__(92413)); -var http = _interopDefault(__webpack_require__(98605)); -var Url = _interopDefault(__webpack_require__(78835)); -var https = _interopDefault(__webpack_require__(57211)); -var zlib = _interopDefault(__webpack_require__(78761)); +var Stream = _interopDefault(__nccwpck_require__(92413)); +var http = _interopDefault(__nccwpck_require__(98605)); +var Url = _interopDefault(__nccwpck_require__(78835)); +var https = _interopDefault(__nccwpck_require__(57211)); +var zlib = _interopDefault(__nccwpck_require__(78761)); // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js @@ -21346,7 +21500,7 @@ FetchError.prototype.name = 'FetchError'; let convert; try { - convert = __webpack_require__(85100)/* .convert */ .O; + convert = __nccwpck_require__(85100)/* .convert */ .O; } catch (e) {} const INTERNALS = Symbol('Body internals'); @@ -22860,16 +23014,16 @@ function extractDescription (d) { /***/ }), /***/ 23492: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var semver = __webpack_require__(85911) -var validateLicense = __webpack_require__(22524); -var hostedGitInfo = __webpack_require__(88869) -var isBuiltinModule = __webpack_require__(39283).isCore +var semver = __nccwpck_require__(85911) +var validateLicense = __nccwpck_require__(22524); +var hostedGitInfo = __nccwpck_require__(88869) +var isBuiltinModule = __nccwpck_require__(39283).isCore var depTypes = ["dependencies","devDependencies","optionalDependencies"] -var extractDescription = __webpack_require__(16976) -var url = __webpack_require__(78835) -var typos = __webpack_require__(49043) +var extractDescription = __nccwpck_require__(16976) +var url = __nccwpck_require__(78835) +var typos = __nccwpck_require__(49043) var fixer = module.exports = { // default warning function @@ -23285,10 +23439,10 @@ function bugsTypos(bugs, warn) { /***/ }), /***/ 29671: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __webpack_require__(31669) -var messages = __webpack_require__(98402) +var util = __nccwpck_require__(31669) +var messages = __nccwpck_require__(98402) module.exports = function() { var args = Array.prototype.slice.call(arguments, 0) @@ -23315,14 +23469,14 @@ function makeTypoWarning (providedName, probableName, field) { /***/ }), /***/ 53188: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = normalize -var fixer = __webpack_require__(23492) +var fixer = __nccwpck_require__(23492) normalize.fixer = fixer -var makeWarning = __webpack_require__(29671) +var makeWarning = __nccwpck_require__(29671) var fieldsToFix = ['name','version','description','repository','modules','scripts' ,'files','bin','man','bugs','keywords','readme','homepage','license'] @@ -23361,12 +23515,12 @@ function ucFirst (string) { /***/ }), /***/ 20502: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const pathKey = __webpack_require__(37278); +const path = __nccwpck_require__(85622); +const pathKey = __nccwpck_require__(37278); const npmRunPath = options => { options = { @@ -23440,9 +23594,9 @@ module.exports.default = pathKey; /***/ }), /***/ 1223: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var wrappy = __webpack_require__(62940) +var wrappy = __nccwpck_require__(62940) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) @@ -23489,71 +23643,65 @@ function onceStrict (fn) { /***/ }), /***/ 89082: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const mimicFn = __webpack_require__(76047); +const mimicFn = __nccwpck_require__(76047); const calledFunctions = new WeakMap(); -const oneTime = (fn, options = {}) => { - if (typeof fn !== 'function') { +const onetime = (function_, options = {}) => { + if (typeof function_ !== 'function') { throw new TypeError('Expected a function'); } - let ret; - let isCalled = false; + let returnValue; let callCount = 0; - const functionName = fn.displayName || fn.name || ''; + const functionName = function_.displayName || function_.name || ''; - const onetime = function (...args) { + const onetime = function (...arguments_) { calledFunctions.set(onetime, ++callCount); - if (isCalled) { - if (options.throw === true) { - throw new Error(`Function \`${functionName}\` can only be called once`); - } - - return ret; + if (callCount === 1) { + returnValue = function_.apply(this, arguments_); + function_ = null; + } else if (options.throw === true) { + throw new Error(`Function \`${functionName}\` can only be called once`); } - isCalled = true; - ret = fn.apply(this, args); - fn = null; - - return ret; + return returnValue; }; - mimicFn(onetime, fn); + mimicFn(onetime, function_); calledFunctions.set(onetime, callCount); return onetime; }; -module.exports = oneTime; +module.exports = onetime; // TODO: Remove this for the next major release -module.exports.default = oneTime; +module.exports.default = onetime; -module.exports.callCount = fn => { - if (!calledFunctions.has(fn)) { - throw new Error(`The given function \`${fn.name}\` is not wrapped by the \`onetime\` package`); +module.exports.callCount = function_ => { + if (!calledFunctions.has(function_)) { + throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); } - return calledFunctions.get(fn); + return calledFunctions.get(function_); }; /***/ }), /***/ 54824: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const macosRelease = __webpack_require__(7493); -const winRelease = __webpack_require__(63515); +const os = __nccwpck_require__(12087); +const macosRelease = __nccwpck_require__(7493); +const winRelease = __nccwpck_require__(63515); const osName = (platform, release) => { if (!platform && release) { @@ -23624,11 +23772,11 @@ module.exports = (promise, onFinally) => { /***/ }), /***/ 57684: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pTry = __webpack_require__(80746); +const pTry = __nccwpck_require__(80746); const pLimit = concurrency => { if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { @@ -23689,11 +23837,11 @@ module.exports.default = pLimit; /***/ }), /***/ 90104: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pLimit = __webpack_require__(57684); +const pLimit = __nccwpck_require__(57684); class EndError extends Error { constructor(value) { @@ -23766,14 +23914,14 @@ module.exports.default = pTry; /***/ }), /***/ 86615: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const errorEx = __webpack_require__(23505); -const fallback = __webpack_require__(55586); -const {default: LinesAndColumns} = __webpack_require__(96309); -const {codeFrameColumns} = __webpack_require__(45211); +const errorEx = __nccwpck_require__(23505); +const fallback = __nccwpck_require__(55586); +const {default: LinesAndColumns} = __nccwpck_require__(96309); +const {codeFrameColumns} = __nccwpck_require__(45211); const JSONError = errorEx('JSONError', { fileName: errorEx.append('in %s'), @@ -23824,12 +23972,12 @@ module.exports = (string, reviver, filename) => { /***/ }), /***/ 96978: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const {promisify} = __webpack_require__(31669); +const fs = __nccwpck_require__(35747); +const {promisify} = __nccwpck_require__(31669); const pAccess = promisify(fs.access); @@ -24005,12 +24153,12 @@ module.exports.win32 = win32.parse; /***/ }), /***/ 63433: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const {promisify} = __webpack_require__(31669); -const fs = __webpack_require__(35747); +const {promisify} = __nccwpck_require__(31669); +const fs = __nccwpck_require__(35747); async function isType(fsStatType, statsMethodName, filePath) { if (typeof filePath !== 'string') { @@ -24056,23 +24204,23 @@ exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink'); /***/ }), /***/ 78569: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports = __webpack_require__(33322); +module.exports = __nccwpck_require__(33322); /***/ }), /***/ 16099: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); +const path = __nccwpck_require__(85622); const WIN_SLASH = '\\\\/'; const WIN_NO_SLASH = `[^${WIN_SLASH}]`; @@ -24254,13 +24402,13 @@ module.exports = { /***/ }), /***/ 92139: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const constants = __webpack_require__(16099); -const utils = __webpack_require__(30479); +const constants = __nccwpck_require__(16099); +const utils = __nccwpck_require__(30479); /** * Constants @@ -25340,16 +25488,16 @@ module.exports = parse; /***/ }), /***/ 33322: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const scan = __webpack_require__(32429); -const parse = __webpack_require__(92139); -const utils = __webpack_require__(30479); -const constants = __webpack_require__(16099); +const path = __nccwpck_require__(85622); +const scan = __nccwpck_require__(32429); +const parse = __nccwpck_require__(92139); +const utils = __nccwpck_require__(30479); +const constants = __nccwpck_require__(16099); const isObject = val => val && typeof val === 'object' && !Array.isArray(val); /** @@ -25687,12 +25835,12 @@ module.exports = picomatch; /***/ }), /***/ 32429: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const utils = __webpack_require__(30479); +const utils = __nccwpck_require__(30479); const { CHAR_ASTERISK, /* * */ CHAR_AT, /* @ */ @@ -25709,7 +25857,7 @@ const { CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_RIGHT_SQUARE_BRACKET /* ] */ -} = __webpack_require__(16099); +} = __nccwpck_require__(16099); const isPathSeparator = code => { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; @@ -26078,19 +26226,19 @@ module.exports = scan; /***/ }), /***/ 30479: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); +const path = __nccwpck_require__(85622); const win32 = process.platform === 'win32'; const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL -} = __webpack_require__(16099); +} = __nccwpck_require__(16099); exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); @@ -26150,11 +26298,11 @@ exports.wrapOutput = (input, state = {}, options = {}) => { /***/ }), /***/ 18341: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var once = __webpack_require__(1223) -var eos = __webpack_require__(81205) -var fs = __webpack_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes +var once = __nccwpck_require__(1223) +var eos = __nccwpck_require__(81205) +var fs = __nccwpck_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} var ancient = /^v?\.0/.test(process.version) @@ -26239,13 +26387,13 @@ module.exports = pump /***/ }), /***/ 75767: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const findUp = __webpack_require__(9486); -const readPkg = __webpack_require__(83645); +const path = __nccwpck_require__(85622); +const findUp = __nccwpck_require__(9486); +const readPkg = __nccwpck_require__(83645); module.exports = async options => { const filePath = await findUp('package.json', options); @@ -26277,14 +26425,14 @@ module.exports.sync = options => { /***/ }), /***/ 83645: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {promisify} = __webpack_require__(31669); -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const parseJson = __webpack_require__(86615); +const {promisify} = __nccwpck_require__(31669); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const parseJson = __nccwpck_require__(86615); const readFileAsync = promisify(fs.readFile); @@ -26299,7 +26447,7 @@ module.exports = async options => { const json = parseJson(await readFileAsync(filePath, 'utf8')); if (options.normalize) { - __webpack_require__(53188)(json); + __nccwpck_require__(53188)(json); } return json; @@ -26316,7 +26464,7 @@ module.exports.sync = options => { const json = parseJson(fs.readFileSync(filePath, 'utf8')); if (options.normalize) { - __webpack_require__(53188)(json); + __nccwpck_require__(53188)(json); } return json; @@ -26326,12 +26474,12 @@ module.exports.sync = options => { /***/ }), /***/ 39283: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var async = __webpack_require__(2125); -async.core = __webpack_require__(26226); -async.isCore = __webpack_require__(38115); -async.sync = __webpack_require__(55284); +var async = __nccwpck_require__(2125); +async.core = __nccwpck_require__(26226); +async.isCore = __nccwpck_require__(38115); +async.sync = __nccwpck_require__(55284); module.exports = async; @@ -26339,14 +26487,14 @@ module.exports = async; /***/ }), /***/ 2125: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var caller = __webpack_require__(36155); -var nodeModulesPaths = __webpack_require__(1433); -var normalizeOptions = __webpack_require__(17990); -var isCore = __webpack_require__(56873); +var fs = __nccwpck_require__(35747); +var path = __nccwpck_require__(85622); +var caller = __nccwpck_require__(36155); +var nodeModulesPaths = __nccwpck_require__(1433); +var normalizeOptions = __nccwpck_require__(17990); +var isCore = __nccwpck_require__(56873); var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; @@ -26660,7 +26808,7 @@ module.exports = function () { /***/ }), /***/ 26226: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; @@ -26706,7 +26854,7 @@ function versionIncluded(specifierValue) { return matchesRange(specifierValue); } -var data = __webpack_require__(5537); +var data = __nccwpck_require__(5537); var core = {}; for (var mod in data) { // eslint-disable-line no-restricted-syntax @@ -26720,9 +26868,9 @@ module.exports = core; /***/ }), /***/ 38115: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isCoreModule = __webpack_require__(56873); +var isCoreModule = __nccwpck_require__(56873); module.exports = function isCore(x) { return isCoreModule(x); @@ -26732,10 +26880,10 @@ module.exports = function isCore(x) { /***/ }), /***/ 1433: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var path = __webpack_require__(85622); -var parse = path.parse || __webpack_require__(5980); +var path = __nccwpck_require__(85622); +var parse = path.parse || __nccwpck_require__(5980); var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { var prefix = '/'; @@ -26798,14 +26946,14 @@ module.exports = function (x, opts) { /***/ }), /***/ 55284: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isCore = __webpack_require__(56873); -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var caller = __webpack_require__(36155); -var nodeModulesPaths = __webpack_require__(1433); -var normalizeOptions = __webpack_require__(17990); +var isCore = __nccwpck_require__(56873); +var fs = __nccwpck_require__(35747); +var path = __nccwpck_require__(85622); +var caller = __nccwpck_require__(36155); +var nodeModulesPaths = __nccwpck_require__(1433); +var normalizeOptions = __nccwpck_require__(17990); var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; @@ -27038,17 +27186,17 @@ module.exports = reusify /***/ }), /***/ 14959: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = rimraf rimraf.sync = rimrafSync -var assert = __webpack_require__(42357) -var path = __webpack_require__(85622) -var fs = __webpack_require__(35747) +var assert = __nccwpck_require__(42357) +var path = __nccwpck_require__(85622) +var fs = __nccwpck_require__(35747) var glob = undefined try { - glob = __webpack_require__(91957) + glob = __nccwpck_require__(91957) } catch (_err) { // treat glob as optional. } @@ -28962,11 +29110,11 @@ function coerce (version) { /***/ }), /***/ 67032: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const shebangRegex = __webpack_require__(72638); +const shebangRegex = __nccwpck_require__(72638); module.exports = (string = '') => { const match = string.match(shebangRegex); @@ -28999,16 +29147,16 @@ module.exports = /^#!(.*)/; /***/ }), /***/ 24931: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. -var assert = __webpack_require__(42357) -var signals = __webpack_require__(63710) +var assert = __nccwpck_require__(42357) +var signals = __nccwpck_require__(63710) var isWin = /^win/i.test(process.platform) -var EE = __webpack_require__(28614) +var EE = __nccwpck_require__(28614) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter @@ -29248,7 +29396,7 @@ module.exports = path => { /***/ }), /***/ 92372: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* Copyright spdx-correct.js contributors @@ -29265,8 +29413,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -var parse = __webpack_require__(31620) -var spdxLicenseIds = __webpack_require__(72172) +var parse = __nccwpck_require__(31620) +var spdxLicenseIds = __nccwpck_require__(72172) function valid (string) { try { @@ -29619,13 +29767,13 @@ function upgradeGPLs (value) { /***/ }), /***/ 31620: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var scan = __webpack_require__(97380) -var parse = __webpack_require__(69868) +var scan = __nccwpck_require__(97380) +var parse = __nccwpck_require__(69868) module.exports = function (source) { return parse(scan(source)) @@ -29781,15 +29929,15 @@ module.exports = function (tokens) { /***/ }), /***/ 97380: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; var licenses = [] - .concat(__webpack_require__(72172)) - .concat(__webpack_require__(94185)) -var exceptions = __webpack_require__(19752) + .concat(__nccwpck_require__(72172)) + .concat(__nccwpck_require__(94185)) +var exceptions = __nccwpck_require__(19752) module.exports = function (source) { var index = 0 @@ -29967,12 +30115,12 @@ module.exports = input => { /***/ }), /***/ 59318: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const hasFlag = __webpack_require__(31621); +const os = __nccwpck_require__(12087); +const hasFlag = __nccwpck_require__(31621); const env = process.env; @@ -30106,10 +30254,10 @@ module.exports = { /***/ }), /***/ 68065: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const {promisify} = __webpack_require__(31669); -const tmp = __webpack_require__(8517); +const {promisify} = __nccwpck_require__(31669); +const tmp = __nccwpck_require__(8517); // file module.exports.fileSync = tmp.fileSync; @@ -30161,7 +30309,7 @@ module.exports.setGracefulCleanup = tmp.setGracefulCleanup; /***/ }), /***/ 8517: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! * Tmp @@ -30174,14 +30322,14 @@ module.exports.setGracefulCleanup = tmp.setGracefulCleanup; /* * Module dependencies. */ -const fs = __webpack_require__(35747); -const os = __webpack_require__(12087); -const path = __webpack_require__(85622); -const crypto = __webpack_require__(76417); +const fs = __nccwpck_require__(35747); +const os = __nccwpck_require__(12087); +const path = __nccwpck_require__(85622); +const crypto = __nccwpck_require__(76417); const _c = fs.constants && os.constants ? { fs: fs.constants, os: os.constants } : process.binding('constants'); -const rimraf = __webpack_require__(14959); +const rimraf = __nccwpck_require__(14959); /* * The working inner variables. @@ -30930,7 +31078,7 @@ module.exports.setGracefulCleanup = setGracefulCleanup; /***/ }), /***/ 1861: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /*! @@ -30942,7 +31090,7 @@ module.exports.setGracefulCleanup = setGracefulCleanup; -const isNumber = __webpack_require__(75680); +const isNumber = __nccwpck_require__(75680); const toRegexRange = (min, max, options) => { if (isNumber(min) === false) { @@ -31226,26 +31374,26 @@ module.exports = toRegexRange; /***/ }), /***/ 74294: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __webpack_require__(54219); +module.exports = __nccwpck_require__(54219); /***/ }), /***/ 54219: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var net = __webpack_require__(11631); -var tls = __webpack_require__(4016); -var http = __webpack_require__(98605); -var https = __webpack_require__(57211); -var events = __webpack_require__(28614); -var assert = __webpack_require__(42357); -var util = __webpack_require__(31669); +var net = __nccwpck_require__(11631); +var tls = __nccwpck_require__(4016); +var http = __nccwpck_require__(98605); +var https = __nccwpck_require__(57211); +var events = __nccwpck_require__(28614); +var assert = __nccwpck_require__(42357); +var util = __nccwpck_require__(31669); exports.httpOverHttp = httpOverHttp; @@ -31506,7 +31654,7 @@ exports.debug = debug; // for test /***/ }), /***/ 45030: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -31515,7 +31663,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var osName = _interopDefault(__webpack_require__(54824)); +var osName = _interopDefault(__nccwpck_require__(54824)); function getUserAgent() { try { @@ -31536,10 +31684,10 @@ exports.getUserAgent = getUserAgent; /***/ }), /***/ 22524: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var parse = __webpack_require__(31620); -var correct = __webpack_require__(92372); +var parse = __nccwpck_require__(31620); +var correct = __nccwpck_require__(92372); var genericWarning = ( 'license should be ' + @@ -31629,15 +31777,15 @@ module.exports = function(argument) { /***/ }), /***/ 34207: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' -const path = __webpack_require__(85622) +const path = __nccwpck_require__(85622) const COLON = isWindows ? ';' : ':' -const isexe = __webpack_require__(97126) +const isexe = __nccwpck_require__(97126) const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) @@ -31761,12 +31909,12 @@ which.sync = whichSync /***/ }), /***/ 63515: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const execa = __webpack_require__(64780); +const os = __nccwpck_require__(12087); +const execa = __nccwpck_require__(64780); // Reference: https://www.gaijin.at/en/lstwinver.php const names = new Map([ @@ -31821,14 +31969,14 @@ module.exports = windowsRelease; /***/ }), /***/ 36868: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const cp = __webpack_require__(63129); -const parse = __webpack_require__(56876); -const enoent = __webpack_require__(48625); +const cp = __nccwpck_require__(63129); +const parse = __nccwpck_require__(56876); +const enoent = __nccwpck_require__(48625); function spawn(command, args, options) { // Parse the arguments @@ -31935,17 +32083,17 @@ module.exports = { /***/ }), /***/ 56876: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const niceTry = __webpack_require__(38560); -const resolveCommand = __webpack_require__(38741); -const escape = __webpack_require__(44300); -const readShebang = __webpack_require__(58536); -const semver = __webpack_require__(85911); +const path = __nccwpck_require__(85622); +const niceTry = __nccwpck_require__(38560); +const resolveCommand = __nccwpck_require__(38741); +const escape = __nccwpck_require__(44300); +const readShebang = __nccwpck_require__(58536); +const semver = __nccwpck_require__(85911); const isWin = process.platform === 'win32'; const isExecutableRegExp = /\.(?:com|exe)$/i; @@ -32121,13 +32269,13 @@ module.exports.argument = escapeArgument; /***/ }), /***/ 58536: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const shebangCommand = __webpack_require__(32116); +const fs = __nccwpck_require__(35747); +const shebangCommand = __nccwpck_require__(32116); function readShebang(command) { // Read the first 150 bytes from the file @@ -32161,14 +32309,14 @@ module.exports = readShebang; /***/ }), /***/ 38741: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const which = __webpack_require__(13411); -const pathKey = __webpack_require__(20539)(); +const path = __nccwpck_require__(85622); +const which = __nccwpck_require__(13411); +const pathKey = __nccwpck_require__(20539)(); function resolveCommandAttempt(parsed, withoutPathExt) { const cwd = process.cwd(); @@ -32216,21 +32364,21 @@ module.exports = resolveCommand; /***/ }), /***/ 64780: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const childProcess = __webpack_require__(63129); -const crossSpawn = __webpack_require__(36868); -const stripEof = __webpack_require__(85515); -const npmRunPath = __webpack_require__(12509); -const isStream = __webpack_require__(12597); -const _getStream = __webpack_require__(72560); -const pFinally = __webpack_require__(31330); -const onExit = __webpack_require__(24931); -const errname = __webpack_require__(32160); -const stdio = __webpack_require__(27023); +const path = __nccwpck_require__(85622); +const childProcess = __nccwpck_require__(63129); +const crossSpawn = __nccwpck_require__(36868); +const stripEof = __nccwpck_require__(85515); +const npmRunPath = __nccwpck_require__(12509); +const isStream = __nccwpck_require__(12597); +const _getStream = __nccwpck_require__(72560); +const pFinally = __nccwpck_require__(31330); +const onExit = __nccwpck_require__(24931); +const errname = __nccwpck_require__(32160); +const stdio = __nccwpck_require__(27023); const TEN_MEGABYTES = 1000 * 1000 * 10; @@ -32585,13 +32733,13 @@ module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, /***/ }), /***/ 32160: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // Older verions of Node.js might not have `util.getSystemErrorName()`. // In that case, fall back to a deprecated internal. -const util = __webpack_require__(31669); +const util = __nccwpck_require__(31669); let uv; @@ -32681,11 +32829,11 @@ module.exports = opts => { /***/ }), /***/ 59286: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {PassThrough} = __webpack_require__(92413); +const {PassThrough} = __nccwpck_require__(92413); module.exports = options => { options = Object.assign({}, options); @@ -32740,12 +32888,12 @@ module.exports = options => { /***/ }), /***/ 72560: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pump = __webpack_require__(18341); -const bufferStream = __webpack_require__(59286); +const pump = __nccwpck_require__(18341); +const bufferStream = __nccwpck_require__(59286); class MaxBufferError extends Error { constructor() { @@ -32827,12 +32975,12 @@ isStream.transform = function (stream) { /***/ }), /***/ 12509: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const pathKey = __webpack_require__(20539); +const path = __nccwpck_require__(85622); +const pathKey = __nccwpck_require__(20539); module.exports = opts => { opts = Object.assign({ @@ -32874,11 +33022,11 @@ module.exports.env = opts => { /***/ }), /***/ 32116: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var shebangRegex = __webpack_require__(52998); +var shebangRegex = __nccwpck_require__(52998); module.exports = function (str) { var match = str.match(shebangRegex); @@ -32911,7 +33059,7 @@ module.exports = /^#!.*/; /***/ }), /***/ 13411: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = which which.sync = whichSync @@ -32920,9 +33068,9 @@ var isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' -var path = __webpack_require__(85622) +var path = __nccwpck_require__(85622) var COLON = isWindows ? ';' : ':' -var isexe = __webpack_require__(97126) +var isexe = __nccwpck_require__(97126) function getNotFoundError (cmd) { var er = new Error('not found: ' + cmd) @@ -33093,22 +33241,25 @@ function wrappy (fn, cb) { /***/ }), /***/ 31252: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* eslint-disable no-console */ -const artifact = __webpack_require__(52605) -const execa = __webpack_require__(55447) -const core = __webpack_require__(42186) -const globby = __webpack_require__(43398) -const readPkgUp = __webpack_require__(75767) -const fs = __webpack_require__(35747) -const { pkg } = __webpack_require__(1590) +const artifact = __nccwpck_require__(52605) +const execa = __nccwpck_require__(55447) +const core = __nccwpck_require__(42186) +const globby = __nccwpck_require__(43398) +const readPkgUp = __nccwpck_require__(75767) +const fs = __nccwpck_require__(35747) +const { pkg } = __nccwpck_require__(1590) const aegirExec = pkg.name === 'aegir' ? './cli.js' : 'aegir' -/** @typedef {import("@actions/github").context } Context */ +/** + * @typedef {import("@actions/github").context } Context + * @typedef {ReturnType} Github + */ /** * Bundle Size Check @@ -33130,7 +33281,7 @@ const sizeCheck = async (octokit, context, baseDir) => { try { check = await checkCreate(octokit, context, checkName) - const out = await execa(aegirExec, ['build', '-b'], { + const out = await execa(aegirExec, ['build', '-b', '--no-types'], { cwd: baseDir, localDir: '.', preferLocal: true, @@ -33165,8 +33316,6 @@ const sizeCheck = async (octokit, context, baseDir) => { } ) } catch (err) { - console.log('err', err) - if (check) { await octokit.checks.update( { @@ -33213,7 +33362,7 @@ module.exports = { /***/ }), /***/ 36553: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -33224,7 +33373,7 @@ Object.defineProperty(exports, "__esModule", ({ exports.codeFrameColumns = codeFrameColumns; exports.default = _default; -var _highlight = _interopRequireWildcard(__webpack_require__(39571)); +var _highlight = _interopRequireWildcard(__nccwpck_require__(39571)); function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } @@ -33247,7 +33396,7 @@ function getMarkerLines(loc, source, opts) { column: 0, line: -1 }, loc.start); - const endLoc = Object.assign({}, startLoc, {}, loc.end); + const endLoc = Object.assign({}, startLoc, loc.end); const { linesAbove = 2, linesBelow = 3 @@ -33326,7 +33475,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) { let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { const number = start + 1 + index; const paddedNumber = ` ${number}`.slice(-numberMaxWidth); - const gutter = ` ${paddedNumber} | `; + const gutter = ` ${paddedNumber} |`; const hasMarker = markerLines[number]; const lastMarkerLine = !markerLines[number + 1]; @@ -33336,16 +33485,16 @@ function codeFrameColumns(rawLines, loc, opts = {}) { if (Array.isArray(hasMarker)) { const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); const numberOfMarkers = hasMarker[1] || 1; - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); if (lastMarkerLine && opts.message) { markerLine += " " + maybeHighlight(defs.message, opts.message); } } - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${line}`; + return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; } }).join("\n"); @@ -33386,8 +33535,201 @@ function _default(rawLines, lineNumber, colNumber, opts = {}) { /***/ }), +/***/ 14705: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isIdentifierStart = isIdentifierStart; +exports.isIdentifierChar = isIdentifierChar; +exports.isIdentifierName = isIdentifierName; +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + +function isInAstralSet(code, set) { + let pos = 0x10000; + + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + + return false; +} + +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes); +} + +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} + +function isIdentifierName(name) { + let isFirst = true; + + for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) { + const char = _Array$from[_i]; + const cp = char.codePointAt(0); + + if (isFirst) { + if (!isIdentifierStart(cp)) { + return false; + } + + isFirst = false; + } else if (!isIdentifierChar(cp)) { + return false; + } + } + + return !isFirst; +} + +/***/ }), + +/***/ 74246: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "isIdentifierName", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierName; + } +})); +Object.defineProperty(exports, "isIdentifierChar", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierChar; + } +})); +Object.defineProperty(exports, "isIdentifierStart", ({ + enumerable: true, + get: function () { + return _identifier.isIdentifierStart; + } +})); +Object.defineProperty(exports, "isReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isReservedWord; + } +})); +Object.defineProperty(exports, "isStrictBindOnlyReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictBindOnlyReservedWord; + } +})); +Object.defineProperty(exports, "isStrictBindReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictBindReservedWord; + } +})); +Object.defineProperty(exports, "isStrictReservedWord", ({ + enumerable: true, + get: function () { + return _keyword.isStrictReservedWord; + } +})); +Object.defineProperty(exports, "isKeyword", ({ + enumerable: true, + get: function () { + return _keyword.isKeyword; + } +})); + +var _identifier = __nccwpck_require__(14705); + +var _keyword = __nccwpck_require__(8755); + +/***/ }), + +/***/ 8755: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isReservedWord = isReservedWord; +exports.isStrictReservedWord = isStrictReservedWord; +exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; +exports.isStrictBindReservedWord = isStrictBindReservedWord; +exports.isKeyword = isKeyword; +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); + +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} + +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} + +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} + +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} + +function isKeyword(word) { + return keywords.has(word); +} + +/***/ }), + /***/ 39571: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -33399,11 +33741,11 @@ exports.shouldHighlight = shouldHighlight; exports.getChalk = getChalk; exports.default = highlight; -var _jsTokens = _interopRequireWildcard(__webpack_require__(52388)); +var jsTokensNs = _interopRequireWildcard(__nccwpck_require__(52388)); -var _helperValidatorIdentifier = __webpack_require__(78207); +var _helperValidatorIdentifier = __nccwpck_require__(74246); -var _chalk = _interopRequireDefault(__webpack_require__(85465)); +var _chalk = _interopRequireDefault(__nccwpck_require__(85465)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -33411,11 +33753,13 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); + function getDefs(chalk) { return { keyword: chalk.cyan, capitalized: chalk.yellow, - jsx_tag: chalk.yellow, + jsxIdentifier: chalk.yellow, punctuator: chalk.yellow, number: chalk.magenta, string: chalk.green, @@ -33426,49 +33770,70 @@ function getDefs(chalk) { } const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -const JSX_TAG = /^[a-z][\w-]*$/i; const BRACKET = /^[()[\]{}]$/; +let tokenize; +{ + const { + matchToToken + } = jsTokensNs; + const JSX_TAG = /^[a-z][\w-]*$/i; -function getTokenType(match) { - const [offset, text] = match.slice(-2); - const token = (0, _jsTokens.matchToToken)(match); + const getTokenType = function (token, offset, text) { + if (token.type === "name") { + if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) { + return "keyword"; + } - if (token.type === "name") { - if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) { - return "keyword"; + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)).join("\n"); + highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n"); } else { - return args[0]; + highlighted += value; } - }); + } + + return highlighted; } function shouldHighlight(options) { @@ -33500,206 +33865,13 @@ function highlight(code, options = {}) { /***/ }), -/***/ 53921: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isIdentifierStart = isIdentifierStart; -exports.isIdentifierChar = isIdentifierChar; -exports.isIdentifierName = isIdentifierName; -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} - -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -function isIdentifierName(name) { - let isFirst = true; - - for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) { - const char = _Array$from[_i]; - const cp = char.codePointAt(0); - - if (isFirst) { - if (!isIdentifierStart(cp)) { - return false; - } - - isFirst = false; - } else if (!isIdentifierChar(cp)) { - return false; - } - } - - return !isFirst; -} - -/***/ }), - -/***/ 78207: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "isIdentifierName", ({ - enumerable: true, - get: function () { - return _identifier.isIdentifierName; - } -})); -Object.defineProperty(exports, "isIdentifierChar", ({ - enumerable: true, - get: function () { - return _identifier.isIdentifierChar; - } -})); -Object.defineProperty(exports, "isIdentifierStart", ({ - enumerable: true, - get: function () { - return _identifier.isIdentifierStart; - } -})); -Object.defineProperty(exports, "isReservedWord", ({ - enumerable: true, - get: function () { - return _keyword.isReservedWord; - } -})); -Object.defineProperty(exports, "isStrictBindOnlyReservedWord", ({ - enumerable: true, - get: function () { - return _keyword.isStrictBindOnlyReservedWord; - } -})); -Object.defineProperty(exports, "isStrictBindReservedWord", ({ - enumerable: true, - get: function () { - return _keyword.isStrictBindReservedWord; - } -})); -Object.defineProperty(exports, "isStrictReservedWord", ({ - enumerable: true, - get: function () { - return _keyword.isStrictReservedWord; - } -})); -Object.defineProperty(exports, "isKeyword", ({ - enumerable: true, - get: function () { - return _keyword.isKeyword; - } -})); - -var _identifier = __webpack_require__(53921); - -var _keyword = __webpack_require__(49313); - -/***/ }), - -/***/ 49313: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isReservedWord = isReservedWord; -exports.isStrictReservedWord = isStrictReservedWord; -exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; -exports.isStrictBindReservedWord = isStrictBindReservedWord; -exports.isKeyword = isKeyword; -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); - -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} - -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} - -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} - -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} - -function isKeyword(word) { - return keywords.has(word); -} - -/***/ }), - /***/ 75762: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); +/* module decorator */ module = __nccwpck_require__.nmd(module); -const colorConvert = __webpack_require__(5254); +const colorConvert = __nccwpck_require__(5254); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); @@ -33868,15 +34040,15 @@ Object.defineProperty(module, 'exports', { /***/ }), /***/ 85465: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const escapeStringRegexp = __webpack_require__(5813); -const ansiStyles = __webpack_require__(75762); -const stdoutColor = __webpack_require__(96278).stdout; +const escapeStringRegexp = __nccwpck_require__(5813); +const ansiStyles = __nccwpck_require__(75762); +const stdoutColor = __nccwpck_require__(96278).stdout; -const template = __webpack_require__(3195); +const template = __nccwpck_require__(3195); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -34240,10 +34412,10 @@ module.exports = (chalk, tmp) => { /***/ }), /***/ 33394: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* MIT license */ -var cssKeywords = __webpack_require__(66658); +var cssKeywords = __nccwpck_require__(66658); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). @@ -35115,10 +35287,10 @@ convert.rgb.gray = function (rgb) { /***/ }), /***/ 5254: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var conversions = __webpack_require__(33394); -var route = __webpack_require__(93476); +var conversions = __nccwpck_require__(33394); +var route = __nccwpck_require__(93476); var convert = {}; @@ -35200,9 +35372,9 @@ module.exports = convert; /***/ }), /***/ 93476: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var conversions = __webpack_require__(33394); +var conversions = __nccwpck_require__(33394); /* this function routes a model to all other models. @@ -35461,15 +35633,31 @@ module.exports = { }; +/***/ }), + +/***/ 63551: +/***/ ((module) => { + +"use strict"; + +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; + + /***/ }), /***/ 96278: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const hasFlag = __webpack_require__(58379); +const os = __nccwpck_require__(12087); +const hasFlag = __nccwpck_require__(63551); const env = process.env; @@ -35603,7 +35791,7 @@ module.exports = { /***/ }), /***/ 3158: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -35619,12 +35807,12 @@ var __rest = (this && this.__rest) || function (s, e) { return t; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const debug_1 = __webpack_require__(30787); -const env_paths_1 = __webpack_require__(47727); -const fs = __webpack_require__(93070); -const path = __webpack_require__(85622); -const url = __webpack_require__(78835); -const sanitize = __webpack_require__(22752); +const debug_1 = __nccwpck_require__(30787); +const env_paths_1 = __nccwpck_require__(47727); +const fs = __nccwpck_require__(93070); +const path = __nccwpck_require__(85622); +const url = __nccwpck_require__(78835); +const crypto = __nccwpck_require__(76417); const d = debug_1.default('@electron/get:cache'); const defaultCacheRoot = env_paths_1.default('electron', { suffix: '', @@ -35633,11 +35821,18 @@ class Cache { constructor(cacheRoot = defaultCacheRoot) { this.cacheRoot = cacheRoot; } + static getCacheDirectory(downloadUrl) { + const parsedDownloadUrl = url.parse(downloadUrl); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { search, hash, pathname } = parsedDownloadUrl, rest = __rest(parsedDownloadUrl, ["search", "hash", "pathname"]); + const strippedUrl = url.format(Object.assign(Object.assign({}, rest), { pathname: path.dirname(pathname || 'electron') })); + return crypto + .createHash('sha256') + .update(strippedUrl) + .digest('hex'); + } getCachePath(downloadUrl, fileName) { - const _a = url.parse(downloadUrl), { search, hash } = _a, rest = __rest(_a, ["search", "hash"]); - const strippedUrl = url.format(rest); - const sanitizedUrl = sanitize(strippedUrl); - return path.resolve(this.cacheRoot, sanitizedUrl, fileName); + return path.resolve(this.cacheRoot, Cache.getCacheDirectory(downloadUrl), fileName); } async getPathForFileInCache(url, fileName) { const cachePath = this.getCachePath(url, fileName); @@ -35663,7 +35858,7 @@ exports.Cache = Cache; /***/ }), /***/ 33425: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -35679,10 +35874,10 @@ var __rest = (this && this.__rest) || function (s, e) { return t; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __webpack_require__(93070); -const got = __webpack_require__(2673); -const path = __webpack_require__(85622); -const ProgressBar = __webpack_require__(9154); +const fs = __nccwpck_require__(93070); +const got = __nccwpck_require__(2673); +const path = __nccwpck_require__(85622); +const ProgressBar = __nccwpck_require__(9154); const PROGRESS_BAR_DELAY_IN_SECONDS = 30; class GotDownloader { async download(url, targetFilePath, options) { @@ -35705,6 +35900,7 @@ class GotDownloader { total: 100, }); // https://github.com/visionmedia/node-progress/issues/159 + // eslint-disable-next-line @typescript-eslint/no-explicit-any bar.start = start; } }, PROGRESS_BAR_DELAY_IN_SECONDS * 1000); @@ -35745,12 +35941,12 @@ exports.GotDownloader = GotDownloader; /***/ }), /***/ 68052: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils_1 = __webpack_require__(41171); +const utils_1 = __nccwpck_require__(41171); const BASE_URL = 'https://github.com/electron/electron/releases/download/'; const NIGHTLY_BASE_URL = 'https://github.com/electron/nightlies/releases/download/'; function getArtifactFileName(details) { @@ -35808,7 +36004,7 @@ exports.getArtifactRemoteURL = getArtifactRemoteURL; /***/ }), /***/ 3252: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -35818,7 +36014,7 @@ async function getDownloaderForSystem() { // Current thoughts are a dot-file traversal for something like // ".electron.downloader" which would be a text file with the name of the // npm module to import() and use as the downloader - const { GotDownloader } = await Promise.resolve().then(() => __webpack_require__(33425)); + const { GotDownloader } = await Promise.resolve().then(() => __nccwpck_require__(33425)); return new GotDownloader(); } exports.getDownloaderForSystem = getDownloaderForSystem; @@ -35827,37 +36023,28 @@ exports.getDownloaderForSystem = getDownloaderForSystem; /***/ }), /***/ 37196: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const debug_1 = __webpack_require__(30787); -const path = __webpack_require__(85622); -const sumchecker = __webpack_require__(85076); -const artifact_utils_1 = __webpack_require__(68052); -const Cache_1 = __webpack_require__(3158); -const downloader_resolver_1 = __webpack_require__(3252); -const proxy_1 = __webpack_require__(7938); -const utils_1 = __webpack_require__(41171); -var utils_2 = __webpack_require__(41171); +const debug_1 = __nccwpck_require__(30787); +const path = __nccwpck_require__(85622); +const semver = __nccwpck_require__(2217); +const sumchecker = __nccwpck_require__(85076); +const artifact_utils_1 = __nccwpck_require__(68052); +const Cache_1 = __nccwpck_require__(3158); +const downloader_resolver_1 = __nccwpck_require__(3252); +const proxy_1 = __nccwpck_require__(7938); +const utils_1 = __nccwpck_require__(41171); +var utils_2 = __nccwpck_require__(41171); exports.getHostArch = utils_2.getHostArch; -var proxy_2 = __webpack_require__(7938); +var proxy_2 = __nccwpck_require__(7938); exports.initializeProxy = proxy_2.initializeProxy; const d = debug_1.default('@electron/get:index'); if (process.env.ELECTRON_GET_USE_PROXY) { proxy_1.initializeProxy(); } -/** - * Downloads a specific version of Electron and returns an absolute path to a - * ZIP file. - * - * @param version - The version of Electron you want to download - */ -function download(version, options) { - return downloadArtifact(Object.assign(Object.assign({}, options), { version, platform: process.platform, arch: process.arch, artifactName: 'electron' })); -} -exports.download = download; /** * Downloads an artifact from an Electron release and returns an absolute path * to the downloaded file. @@ -35908,8 +36095,10 @@ async function downloadArtifact(_artifactDetails) { d(`Downloading ${url} to ${tempDownloadPath} with options: ${JSON.stringify(artifactDetails.downloadOptions)}`); await downloader.download(url, tempDownloadPath, artifactDetails.downloadOptions); // Don't try to verify the hash of the hash file itself + // and for older versions that don't have a SHASUMS256.txt if (!artifactDetails.artifactName.startsWith('SHASUMS256') && - !artifactDetails.unsafelyDisableChecksums) { + !artifactDetails.unsafelyDisableChecksums && + semver.gte(artifactDetails.version, '1.3.2')) { const shasumPath = await downloadArtifact({ isGeneric: true, version: artifactDetails.version, @@ -35920,25 +36109,45 @@ async function downloadArtifact(_artifactDetails) { downloader: artifactDetails.downloader, mirrorOptions: artifactDetails.mirrorOptions, }); - await sumchecker('sha256', shasumPath, path.dirname(tempDownloadPath), [ - path.basename(tempDownloadPath), - ]); + // For versions 1.3.2 - 1.3.4, need to overwrite the `defaultTextEncoding` option: + // https://github.com/electron/electron/pull/6676#discussion_r75332120 + if (semver.satisfies(artifactDetails.version, '1.3.2 - 1.3.4')) { + const validatorOptions = {}; + validatorOptions.defaultTextEncoding = 'binary'; + const checker = new sumchecker.ChecksumValidator('sha256', shasumPath, validatorOptions); + await checker.validate(path.dirname(tempDownloadPath), path.basename(tempDownloadPath)); + } + else { + await sumchecker('sha256', shasumPath, path.dirname(tempDownloadPath), [ + path.basename(tempDownloadPath), + ]); + } } return await cache.putFileInCache(url, tempDownloadPath, fileName); }); } exports.downloadArtifact = downloadArtifact; +/** + * Downloads a specific version of Electron and returns an absolute path to a + * ZIP file. + * + * @param version - The version of Electron you want to download + */ +function download(version, options) { + return downloadArtifact(Object.assign(Object.assign({}, options), { version, platform: process.platform, arch: process.arch, artifactName: 'electron' })); +} +exports.download = download; //# sourceMappingURL=index.js.map /***/ }), /***/ 7938: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const debug = __webpack_require__(30787); +const debug = __nccwpck_require__(30787); const d = debug('@electron/get:proxy'); /** * Initializes a third-party proxy module for HTTP(S) requests. @@ -35949,11 +36158,11 @@ function initializeProxy() { const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10); if (MAJOR_NODEJS_VERSION >= 10) { // `global-agent` works with Node.js v10 and above. - __webpack_require__(22407)/* .bootstrap */ .Ux(); + __nccwpck_require__(22407)/* .bootstrap */ .Ux(); } else { // `global-tunnel-ng` works with Node.js v10 and below. - __webpack_require__(2667).initialize(); + __nccwpck_require__(2667).initialize(); } } catch (e) { @@ -35966,15 +36175,15 @@ exports.initializeProxy = initializeProxy; /***/ }), /***/ 41171: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const childProcess = __webpack_require__(63129); -const fs = __webpack_require__(93070); -const os = __webpack_require__(12087); -const path = __webpack_require__(85622); +const childProcess = __nccwpck_require__(63129); +const fs = __nccwpck_require__(93070); +const os = __nccwpck_require__(12087); +const path = __nccwpck_require__(85622); async function useAndRemoveDirectory(directory, fn) { let result; try { @@ -36012,20 +36221,13 @@ function uname() { .trim(); } exports.uname = uname; -/** - * Generates an architecture name that would be used in an Electron or Node.js - * download file name, from the `process` module information. - */ -function getHostArch() { - return getNodeArch(process.arch); -} -exports.getHostArch = getHostArch; /** * Generates an architecture name that would be used in an Electron or Node.js * download file name. */ function getNodeArch(arch) { if (arch === 'arm') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any switch (process.config.variables.arm_version) { case '6': return uname(); @@ -36037,6 +36239,14 @@ function getNodeArch(arch) { return arch; } exports.getNodeArch = getNodeArch; +/** + * Generates an architecture name that would be used in an Electron or Node.js + * download file name, from the `process` module information. + */ +function getHostArch() { + return getNodeArch(process.arch); +} +exports.getHostArch = getHostArch; function ensureIsTruthyString(obj, key) { if (!obj[key] || typeof obj[key] !== 'string') { throw new Error(`Expected property "${key}" to be provided as a string but it was not`); @@ -36055,16 +36265,16 @@ exports.isOfficialLinuxIA32Download = isOfficialLinuxIA32Download; /***/ }), /***/ 88258: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirpSync = __webpack_require__(58844).mkdirsSync -const utimesSync = __webpack_require__(97408).utimesMillisSync -const stat = __webpack_require__(77928) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdirpSync = __nccwpck_require__(58844).mkdirsSync +const utimesSync = __nccwpck_require__(97408).utimesMillisSync +const stat = __nccwpck_require__(77928) function copySync (src, dest, opts) { if (typeof opts === 'function') { @@ -36137,7 +36347,7 @@ function copyFile (srcStat, src, dest, opts) { function copyFileFallback (srcStat, src, dest, opts) { const BUF_LENGTH = 64 * 1024 - const _buff = __webpack_require__(72946)(BUF_LENGTH) + const _buff = __nccwpck_require__(72946)(BUF_LENGTH) const fdr = fs.openSync(src, 'r') const fdw = fs.openSync(dest, 'w', srcStat.mode) @@ -36227,30 +36437,30 @@ module.exports = copySync /***/ }), /***/ 5799: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - copySync: __webpack_require__(88258) + copySync: __nccwpck_require__(88258) } /***/ }), /***/ 73564: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirp = __webpack_require__(58844).mkdirs -const pathExists = __webpack_require__(86119).pathExists -const utimes = __webpack_require__(97408).utimesMillis -const stat = __webpack_require__(77928) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdirp = __nccwpck_require__(58844).mkdirs +const pathExists = __nccwpck_require__(86119).pathExists +const utimes = __nccwpck_require__(97408).utimesMillis +const stat = __nccwpck_require__(77928) function copy (src, dest, opts, cb) { if (typeof opts === 'function' && !cb) { @@ -36460,30 +36670,30 @@ module.exports = copy /***/ }), /***/ 23583: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E +const u = __nccwpck_require__(24437)/* .fromCallback */ .E module.exports = { - copy: u(__webpack_require__(73564)) + copy: u(__nccwpck_require__(73564)) } /***/ }), /***/ 93813: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(58844) -const remove = __webpack_require__(40153) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(58844) +const remove = __nccwpck_require__(40153) const emptyDir = u(function emptyDir (dir, callback) { callback = callback || function () {} @@ -36530,16 +36740,16 @@ module.exports = { /***/ }), /***/ 37184: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(58844) -const pathExists = __webpack_require__(86119).pathExists +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const mkdir = __nccwpck_require__(58844) +const pathExists = __nccwpck_require__(86119).pathExists function createFile (file, callback) { function makeFile () { @@ -36587,14 +36797,14 @@ module.exports = { /***/ }), /***/ 87910: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const file = __webpack_require__(37184) -const link = __webpack_require__(92109) -const symlink = __webpack_require__(70517) +const file = __nccwpck_require__(37184) +const link = __nccwpck_require__(92109) +const symlink = __nccwpck_require__(70517) module.exports = { // file @@ -36618,16 +36828,16 @@ module.exports = { /***/ }), /***/ 92109: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(58844) -const pathExists = __webpack_require__(86119).pathExists +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const mkdir = __nccwpck_require__(58844) +const pathExists = __nccwpck_require__(86119).pathExists function createLink (srcpath, dstpath, callback) { function makeLink (srcpath, dstpath) { @@ -36687,14 +36897,14 @@ module.exports = { /***/ }), /***/ 59082: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const pathExists = __webpack_require__(86119).pathExists +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const pathExists = __nccwpck_require__(86119).pathExists /** * Function that returns two types of paths, one relative to symlink, and one @@ -36794,12 +37004,12 @@ module.exports = { /***/ }), /***/ 38636: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) +const fs = __nccwpck_require__(82161) function symlinkType (srcpath, type, callback) { callback = (typeof type === 'function') ? type : callback @@ -36833,27 +37043,27 @@ module.exports = { /***/ }), /***/ 70517: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const _mkdirs = __webpack_require__(58844) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const _mkdirs = __nccwpck_require__(58844) const mkdirs = _mkdirs.mkdirs const mkdirsSync = _mkdirs.mkdirsSync -const _symlinkPaths = __webpack_require__(59082) +const _symlinkPaths = __nccwpck_require__(59082) const symlinkPaths = _symlinkPaths.symlinkPaths const symlinkPathsSync = _symlinkPaths.symlinkPathsSync -const _symlinkType = __webpack_require__(38636) +const _symlinkType = __nccwpck_require__(38636) const symlinkType = _symlinkType.symlinkType const symlinkTypeSync = _symlinkType.symlinkTypeSync -const pathExists = __webpack_require__(86119).pathExists +const pathExists = __nccwpck_require__(86119).pathExists function createSymlink (srcpath, dstpath, type, callback) { callback = (typeof type === 'function') ? type : callback @@ -36904,14 +37114,14 @@ module.exports = { /***/ }), /***/ 59330: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; // This is adapted from https://github.com/normalize/mz // Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors -const u = __webpack_require__(24437)/* .fromCallback */ .E -const fs = __webpack_require__(82161) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const fs = __nccwpck_require__(82161) const api = [ 'access', @@ -37021,7 +37231,7 @@ if (typeof fs.realpath.native === 'function') { /***/ }), /***/ 93070: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -37029,24 +37239,24 @@ if (typeof fs.realpath.native === 'function') { module.exports = Object.assign( {}, // Export promiseified graceful-fs: - __webpack_require__(59330), + __nccwpck_require__(59330), // Export extra methods: - __webpack_require__(5799), - __webpack_require__(23583), - __webpack_require__(93813), - __webpack_require__(87910), - __webpack_require__(13148), - __webpack_require__(58844), - __webpack_require__(22332), - __webpack_require__(77818), - __webpack_require__(28158), - __webpack_require__(86119), - __webpack_require__(40153) + __nccwpck_require__(5799), + __nccwpck_require__(23583), + __nccwpck_require__(93813), + __nccwpck_require__(87910), + __nccwpck_require__(13148), + __nccwpck_require__(58844), + __nccwpck_require__(22332), + __nccwpck_require__(77818), + __nccwpck_require__(28158), + __nccwpck_require__(86119), + __nccwpck_require__(40153) ) // Export fs.promises as a getter property so that we don't trigger // ExperimentalWarning before fs.promises is actually accessed. -const fs = __webpack_require__(35747) +const fs = __nccwpck_require__(35747) if (Object.getOwnPropertyDescriptor(fs, 'promises')) { Object.defineProperty(module.exports, "promises", ({ get () { return fs.promises } @@ -37057,16 +37267,16 @@ if (Object.getOwnPropertyDescriptor(fs, 'promises')) { /***/ }), /***/ 13148: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const jsonFile = __webpack_require__(48229) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const jsonFile = __nccwpck_require__(48229) -jsonFile.outputJson = u(__webpack_require__(44029)) -jsonFile.outputJsonSync = __webpack_require__(86105) +jsonFile.outputJson = u(__nccwpck_require__(44029)) +jsonFile.outputJsonSync = __nccwpck_require__(86105) // aliases jsonFile.outputJSON = jsonFile.outputJson jsonFile.outputJSONSync = jsonFile.outputJsonSync @@ -37081,13 +37291,13 @@ module.exports = jsonFile /***/ }), /***/ 48229: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const jsonFile = __webpack_require__(28302) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const jsonFile = __nccwpck_require__(28302) module.exports = { // jsonfile exports @@ -37101,15 +37311,15 @@ module.exports = { /***/ }), /***/ 86105: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(58844) -const jsonFile = __webpack_require__(48229) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(58844) +const jsonFile = __nccwpck_require__(48229) function outputJsonSync (file, data, options) { const dir = path.dirname(file) @@ -37127,15 +37337,15 @@ module.exports = outputJsonSync /***/ }), /***/ 44029: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(58844) -const pathExists = __webpack_require__(86119).pathExists -const jsonFile = __webpack_require__(48229) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(58844) +const pathExists = __nccwpck_require__(86119).pathExists +const jsonFile = __nccwpck_require__(48229) function outputJson (file, data, options, callback) { if (typeof options === 'function') { @@ -37162,13 +37372,13 @@ module.exports = outputJson /***/ }), /***/ 58844: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const mkdirs = u(__webpack_require__(46010)) -const mkdirsSync = __webpack_require__(60214) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const mkdirs = u(__nccwpck_require__(46010)) +const mkdirsSync = __nccwpck_require__(60214) module.exports = { mkdirs, @@ -37184,14 +37394,14 @@ module.exports = { /***/ }), /***/ 60214: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const invalidWin32Path = __webpack_require__(96793).invalidWin32Path +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const invalidWin32Path = __nccwpck_require__(96793).invalidWin32Path const o777 = parseInt('0777', 8) @@ -37246,14 +37456,14 @@ module.exports = mkdirsSync /***/ }), /***/ 46010: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const invalidWin32Path = __webpack_require__(96793).invalidWin32Path +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const invalidWin32Path = __nccwpck_require__(96793).invalidWin32Path const o777 = parseInt('0777', 8) @@ -37317,12 +37527,12 @@ module.exports = mkdirs /***/ }), /***/ 96793: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622) +const path = __nccwpck_require__(85622) // get drive on windows function getRootPath (p) { @@ -37350,30 +37560,30 @@ module.exports = { /***/ }), /***/ 22332: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - moveSync: __webpack_require__(65613) + moveSync: __nccwpck_require__(65613) } /***/ }), /***/ 65613: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copySync = __webpack_require__(5799).copySync -const removeSync = __webpack_require__(40153).removeSync -const mkdirpSync = __webpack_require__(58844).mkdirpSync -const stat = __webpack_require__(77928) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const copySync = __nccwpck_require__(5799).copySync +const removeSync = __nccwpck_require__(40153).removeSync +const mkdirpSync = __nccwpck_require__(58844).mkdirpSync +const stat = __nccwpck_require__(77928) function moveSync (src, dest, opts) { opts = opts || {} @@ -37418,32 +37628,32 @@ module.exports = moveSync /***/ }), /***/ 77818: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E +const u = __nccwpck_require__(24437)/* .fromCallback */ .E module.exports = { - move: u(__webpack_require__(36000)) + move: u(__nccwpck_require__(36000)) } /***/ }), /***/ 36000: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copy = __webpack_require__(23583).copy -const remove = __webpack_require__(40153).remove -const mkdirp = __webpack_require__(58844).mkdirp -const pathExists = __webpack_require__(86119).pathExists -const stat = __webpack_require__(77928) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const copy = __nccwpck_require__(23583).copy +const remove = __nccwpck_require__(40153).remove +const mkdirp = __nccwpck_require__(58844).mkdirp +const pathExists = __nccwpck_require__(86119).pathExists +const stat = __nccwpck_require__(77928) function move (src, dest, opts, cb) { if (typeof opts === 'function') { @@ -37505,16 +37715,16 @@ module.exports = move /***/ }), /***/ 28158: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(58844) -const pathExists = __webpack_require__(86119).pathExists +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(58844) +const pathExists = __nccwpck_require__(86119).pathExists function outputFile (file, data, encoding, callback) { if (typeof encoding === 'function') { @@ -37553,12 +37763,12 @@ module.exports = { /***/ }), /***/ 86119: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromPromise */ .p -const fs = __webpack_require__(59330) +const u = __nccwpck_require__(24437)/* .fromPromise */ .p +const fs = __nccwpck_require__(59330) function pathExists (path) { return fs.access(path).then(() => true).catch(() => false) @@ -37573,13 +37783,13 @@ module.exports = { /***/ }), /***/ 40153: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const u = __webpack_require__(24437)/* .fromCallback */ .E -const rimraf = __webpack_require__(32852) +const u = __nccwpck_require__(24437)/* .fromCallback */ .E +const rimraf = __nccwpck_require__(32852) module.exports = { remove: u(rimraf), @@ -37590,14 +37800,14 @@ module.exports = { /***/ }), /***/ 32852: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const assert = __webpack_require__(42357) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const assert = __nccwpck_require__(42357) const isWindows = (process.platform === 'win32') @@ -37932,13 +38142,13 @@ module.exports = function (size) { /***/ }), /***/ 77928: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) const NODE_VERSION_MAJOR_WITH_BIGINT = 10 const NODE_VERSION_MINOR_WITH_BIGINT = 5 @@ -38112,14 +38322,14 @@ module.exports = { /***/ }), /***/ 97408: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const os = __webpack_require__(12087) -const path = __webpack_require__(85622) +const fs = __nccwpck_require__(82161) +const os = __nccwpck_require__(12087) +const path = __nccwpck_require__(85622) // HFS, ext{2,3}, FAT do not, Node.js v0.10 does not function hasMillisResSync () { @@ -38199,13 +38409,13 @@ module.exports = { /***/ }), /***/ 28302: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var _fs try { - _fs = __webpack_require__(82161) + _fs = __nccwpck_require__(82161) } catch (_) { - _fs = __webpack_require__(35747) + _fs = __nccwpck_require__(35747) } function readFile (file, options, callback) { @@ -38339,6332 +38549,2678 @@ module.exports = jsonfile /***/ }), -/***/ 24437: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - +/***/ 2217: +/***/ ((module, exports) => { -exports.E = function (fn) { - return Object.defineProperty(function () { - if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) - else { - return new Promise((resolve, reject) => { - arguments[arguments.length] = (err, res) => { - if (err) return reject(err) - resolve(res) - } - arguments.length++ - fn.apply(this, arguments) - }) - } - }, 'name', { value: fn.name }) -} +exports = module.exports = SemVer -exports.p = function (fn) { - return Object.defineProperty(function () { - const cb = arguments[arguments.length - 1] - if (typeof cb !== 'function') return fn.apply(this, arguments) - else fn.apply(this, arguments).then(r => cb(null, r), cb) - }, 'name', { value: fn.name }) +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} } +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' -/***/ }), +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 -/***/ 24120: -/***/ ((module, exports, __webpack_require__) => { +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 -"use strict"; +// The actual regexps go on exports.re +var re = exports.re = [] +var src = exports.src = [] +var t = exports.tokens = {} +var R = 0 -/// -/// -/// -/// -Object.defineProperty(exports, "__esModule", ({ value: true })); -// TODO: Use the `URL` global when targeting Node.js 10 -// tslint:disable-next-line -const URLGlobal = typeof URL === 'undefined' ? __webpack_require__(78835).URL : URL; -const toString = Object.prototype.toString; -const isOfType = (type) => (value) => typeof value === type; -const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input); -const getObjectType = (value) => { - const objectName = toString.call(value).slice(8, -1); - if (objectName) { - return objectName; - } - return null; -}; -const isObjectOfType = (type) => (value) => getObjectType(value) === type; -function is(value) { - switch (value) { - case null: - return "null" /* null */; - case true: - case false: - return "boolean" /* boolean */; - default: - } - switch (typeof value) { - case 'undefined': - return "undefined" /* undefined */; - case 'string': - return "string" /* string */; - case 'number': - return "number" /* number */; - case 'symbol': - return "symbol" /* symbol */; - default: - } - if (is.function_(value)) { - return "Function" /* Function */; - } - if (is.observable(value)) { - return "Observable" /* Observable */; - } - if (Array.isArray(value)) { - return "Array" /* Array */; - } - if (isBuffer(value)) { - return "Buffer" /* Buffer */; - } - const tagType = getObjectType(value); - if (tagType) { - return tagType; - } - if (value instanceof String || value instanceof Boolean || value instanceof Number) { - throw new TypeError('Please don\'t use object wrappers for primitive types'); - } - return "Object" /* Object */; +function tok (n) { + t[n] = R++ } -(function (is) { - // tslint:disable-next-line:strict-type-predicates - const isObject = (value) => typeof value === 'object'; - // tslint:disable:variable-name - is.undefined = isOfType('undefined'); - is.string = isOfType('string'); - is.number = isOfType('number'); - is.function_ = isOfType('function'); - // tslint:disable-next-line:strict-type-predicates - is.null_ = (value) => value === null; - is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); - is.boolean = (value) => value === true || value === false; - is.symbol = isOfType('symbol'); - // tslint:enable:variable-name - is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value)); - is.array = Array.isArray; - is.buffer = isBuffer; - is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); - is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value)); - is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]); - is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]); - is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); - is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value); - const hasPromiseAPI = (value) => !is.null_(value) && - isObject(value) && - is.function_(value.then) && - is.function_(value.catch); - is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); - is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */); - is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */); - is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); - is.regExp = isObjectOfType("RegExp" /* RegExp */); - is.date = isObjectOfType("Date" /* Date */); - is.error = isObjectOfType("Error" /* Error */); - is.map = (value) => isObjectOfType("Map" /* Map */)(value); - is.set = (value) => isObjectOfType("Set" /* Set */)(value); - is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value); - is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value); - is.int8Array = isObjectOfType("Int8Array" /* Int8Array */); - is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */); - is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */); - is.int16Array = isObjectOfType("Int16Array" /* Int16Array */); - is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */); - is.int32Array = isObjectOfType("Int32Array" /* Int32Array */); - is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */); - is.float32Array = isObjectOfType("Float32Array" /* Float32Array */); - is.float64Array = isObjectOfType("Float64Array" /* Float64Array */); - is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */); - is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */); - is.dataView = isObjectOfType("DataView" /* DataView */); - is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype; - is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value); - is.urlString = (value) => { - if (!is.string(value)) { - return false; - } - try { - new URLGlobal(value); // tslint:disable-line no-unused-expression - return true; - } - catch (_a) { - return false; - } - }; - is.truthy = (value) => Boolean(value); - is.falsy = (value) => !value; - is.nan = (value) => Number.isNaN(value); - const primitiveTypes = new Set([ - 'undefined', - 'string', - 'number', - 'boolean', - 'symbol' - ]); - is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value); - is.integer = (value) => Number.isInteger(value); - is.safeInteger = (value) => Number.isSafeInteger(value); - is.plainObject = (value) => { - // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js - let prototype; - return getObjectType(value) === "Object" /* Object */ && - (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator - prototype === Object.getPrototypeOf({})); - }; - const typedArrayTypes = new Set([ - "Int8Array" /* Int8Array */, - "Uint8Array" /* Uint8Array */, - "Uint8ClampedArray" /* Uint8ClampedArray */, - "Int16Array" /* Int16Array */, - "Uint16Array" /* Uint16Array */, - "Int32Array" /* Int32Array */, - "Uint32Array" /* Uint32Array */, - "Float32Array" /* Float32Array */, - "Float64Array" /* Float64Array */ - ]); - is.typedArray = (value) => { - const objectType = getObjectType(value); - if (objectType === null) { - return false; - } - return typedArrayTypes.has(objectType); - }; - const isValidLength = (value) => is.safeInteger(value) && value > -1; - is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); - is.inRange = (value, range) => { - if (is.number(range)) { - return value >= Math.min(0, range) && value <= Math.max(range, 0); - } - if (is.array(range) && range.length === 2) { - return value >= Math.min(...range) && value <= Math.max(...range); - } - throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); - }; - const NODE_TYPE_ELEMENT = 1; - const DOM_PROPERTIES_TO_CHECK = [ - 'innerHTML', - 'ownerDocument', - 'style', - 'attributes', - 'nodeValue' - ]; - is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && - !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); - is.observable = (value) => { - if (!value) { - return false; - } - if (value[Symbol.observable] && value === value[Symbol.observable]()) { - return true; - } - if (value['@@observable'] && value === value['@@observable']()) { - return true; - } - return false; - }; - is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value); - is.infinite = (value) => value === Infinity || value === -Infinity; - const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem; - is.even = isAbsoluteMod2(0); - is.odd = isAbsoluteMod2(1); - const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false; - is.emptyArray = (value) => is.array(value) && value.length === 0; - is.nonEmptyArray = (value) => is.array(value) && value.length > 0; - is.emptyString = (value) => is.string(value) && value.length === 0; - is.nonEmptyString = (value) => is.string(value) && value.length > 0; - is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); - is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; - is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; - is.emptySet = (value) => is.set(value) && value.size === 0; - is.nonEmptySet = (value) => is.set(value) && value.size > 0; - is.emptyMap = (value) => is.map(value) && value.size === 0; - is.nonEmptyMap = (value) => is.map(value) && value.size > 0; - const predicateOnArray = (method, predicate, values) => { - if (is.function_(predicate) === false) { - throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); - } - if (values.length === 0) { - throw new TypeError('Invalid number of values'); - } - return method.call(values, predicate); - }; - // tslint:disable variable-name - is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values); - is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); - // tslint:enable variable-name -})(is || (is = {})); -// Some few keywords are reserved, but we'll populate them for Node.js users -// See https://github.com/Microsoft/TypeScript/issues/2536 -Object.defineProperties(is, { - class: { - value: is.class_ - }, - function: { - value: is.function_ - }, - null: { - value: is.null_ - } -}); -exports.default = is; -// For CommonJS default export support -module.exports = is; -module.exports.default = is; -//# sourceMappingURL=index.js.map - -/***/ }), -/***/ 8595: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. -"use strict"; +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. -const deferToConnect = __webpack_require__(12097); +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' -module.exports = request => { - const timings = { - start: Date.now(), - socket: null, - lookup: null, - connect: null, - upload: null, - response: null, - end: null, - error: null, - phases: { - wait: null, - dns: null, - tcp: null, - request: null, - firstByte: null, - download: null, - total: null - } - }; +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. - const handleError = origin => { - const emit = origin.emit.bind(origin); - origin.emit = (event, ...args) => { - // Catches the `error` event - if (event === 'error') { - timings.error = Date.now(); - timings.phases.total = timings.error - timings.start; +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' - origin.emit = emit; - } +// ## Main Version +// Three dot-separated numeric identifiers. - // Saves the original behavior - return emit(event, ...args); - }; - }; +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' - let uploadFinished = false; - const onUpload = () => { - timings.upload = Date.now(); - timings.phases.request = timings.upload - timings.connect; - }; +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' - handleError(request); +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. - request.once('socket', socket => { - timings.socket = Date.now(); - timings.phases.wait = timings.socket - timings.start; +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' - const lookupListener = () => { - timings.lookup = Date.now(); - timings.phases.dns = timings.lookup - timings.socket; - }; +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' - socket.once('lookup', lookupListener); +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. - deferToConnect(socket, () => { - timings.connect = Date.now(); +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' - if (timings.lookup === null) { - socket.removeListener('lookup', lookupListener); - timings.lookup = timings.connect; - timings.phases.dns = timings.lookup - timings.socket; - } +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' - timings.phases.tcp = timings.connect - timings.lookup; +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. - if (uploadFinished && !timings.upload) { - onUpload(); - } - }); - }); +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' - request.once('finish', () => { - uploadFinished = true; +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. - if (timings.connect) { - onUpload(); - } - }); +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' - request.once('response', response => { - timings.response = Date.now(); - timings.phases.firstByte = timings.response - timings.upload; +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. - handleError(response); +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. - response.once('end', () => { - timings.end = Date.now(); - timings.phases.download = timings.end - timings.response; - timings.phases.total = timings.end - timings.start; - }); - }); +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' - return timings; -}; +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' -/***/ }), +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' -/***/ 58588: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +tok('GTLT') +src[t.GTLT] = '((?:<|>)?=?)' -"use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = __webpack_require__(73991); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +tok('COERCE') +src[t.COERCE] = '(^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' +tok('COERCERTL') +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') - return styles; -}; +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - 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], +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +var tildeTrimReplace = '$1~' - // Bright color - 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], +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +var caretTrimReplace = '$1^' - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' - group[styleName] = styles[styleName]; +// A simple gt/lt/eq thing, or just "" to indicate "any version" +tok('COMPARATORLOOSE') +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' +tok('COMPARATOR') +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' - codes.set(style[0], style[1]); - } +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +tok('COMPARATORTRIM') +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +var comparatorTrimReplace = '$1$2$3' - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +tok('HYPHENRANGE') +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAIN] + ')' + + '\\s*$' - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$' - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); +// Star ranges basically just allow anything at all. +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' - return styles; +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + } } -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); - - -/***/ }), - -/***/ 52357: -/***/ ((module) => { - -"use strict"; - - -// there's 3 implementations written in increasing order of efficiency - -// 1 - no Set type is defined -function uniqNoSet(arr) { - var ret = []; - - for (var i = 0; i < arr.length; i++) { - if (ret.indexOf(arr[i]) === -1) { - ret.push(arr[i]); - } - } - - return ret; -} +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } -// 2 - a simple Set type is defined -function uniqSet(arr) { - var seen = new Set(); - return arr.filter(function (el) { - if (!seen.has(el)) { - seen.add(el); - return true; - } + if (version instanceof SemVer) { + return version + } - return false; - }); -} + if (typeof version !== 'string') { + return null + } -// 3 - a standard Set type is defined and it has a forEach method -function uniqSetWithForEach(arr) { - var ret = []; + if (version.length > MAX_LENGTH) { + return null + } - (new Set(arr)).forEach(function (el) { - ret.push(el); - }); + var r = options.loose ? re[t.LOOSE] : re[t.FULL] + if (!r.test(version)) { + return null + } - return ret; + try { + return new SemVer(version, options) + } catch (er) { + return null + } } -// V8 currently has a broken implementation -// https://github.com/joyent/node/issues/8449 -function doesForEachActuallyWork() { - var ret = false; - - (new Set([true])).forEach(function (el) { - ret = el; - }); - - return ret === true; +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null } -if ('Set' in global) { - if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) { - module.exports = uniqSetWithForEach; - } else { - module.exports = uniqSet; - } -} else { - module.exports = uniqNoSet; +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null } +exports.SemVer = SemVer -/***/ }), - -/***/ 84653: -/***/ (function(module, exports, __webpack_require__) { - -/* module decorator */ module = __webpack_require__.nmd(module); -(function (global, factory) { - true ? factory(exports) : - 0; -}(this, (function (exports) { 'use strict'; - -function slice(arrayLike, start) { - start = start|0; - var newLen = Math.max(arrayLike.length - start, 0); - var newArr = Array(newLen); - for(var idx = 0; idx < newLen; idx++) { - newArr[idx] = arrayLike[start + idx]; +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false } - return newArr; -} + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } -/** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ -var apply = function(fn/*, ...args*/) { - var args = slice(arguments, 1); - return function(/*callArgs*/) { - var callArgs = slice(arguments); - return fn.apply(null, args.concat(callArgs)); - }; -}; + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } -var initialParams = function (fn) { - return function (/*...args, callback*/) { - var args = slice(arguments); - var callback = args.pop(); - fn.call(this, args, callback); - }; -}; + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); -} + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose -var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; -var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) -function fallback(fn) { - setTimeout(fn, 0); -} + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } -function wrap(defer) { - return function (fn/*, ...args*/) { - var args = slice(arguments, 1); - defer(function () { - fn.apply(null, args); - }); - }; -} + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] -var _defer; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } -if (hasSetImmediate) { - _defer = setImmediate; -} else if (hasNextTick) { - _defer = process.nextTick; -} else { - _defer = fallback; -} + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } -var setImmediate$1 = wrap(_defer); + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - return initialParams(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (isObject(result) && typeof result.then === 'function') { - result.then(function(value) { - invokeCallback(callback, null, value); - }, function(err) { - invokeCallback(callback, err.message ? err : new Error(err)); - }); - } else { - callback(null, result); + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num } - }); -} + } + return id + }) + } -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (e) { - setImmediate$1(rethrow, e); - } + this.build = m[5] ? m[5].split('.') : [] + this.format() } -function rethrow(error) { - throw error; +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version } -var supportsSymbol = typeof Symbol === 'function'; - -function isAsync(fn) { - return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction'; +SemVer.prototype.toString = function () { + return this.version } -function wrapAsync(asyncFn) { - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; -} +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } -function applyEach$1(eachfn) { - return function(fns/*, ...args*/) { - var args = slice(arguments, 1); - var go = initialParams(function(args, callback) { - var that = this; - return eachfn(fns, function (fn, cb) { - wrapAsync(fn).apply(that, args.concat(cb)); - }, callback); - }); - if (args.length) { - return go.apply(this, args); - } - else { - return go; - } - }; + return this.compareMain(other) || this.comparePre(other) } -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Built-in value references. */ -var Symbol$1 = root.Symbol; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } -/** Built-in value references. */ -var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined; + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag$1), - tag = value[symToStringTag$1]; +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - try { - value[symToStringTag$1] = undefined; - var unmasked = true; - } catch (e) {} + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag$1] = tag; + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue } else { - delete value[symToStringTag$1]; + return compareIdentifiers(a, b) } - } - return result; + } while (++i) } -/** Used for built-in method references. */ -var objectProto$1 = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString$1 = objectProto$1.toString; +SemVer.prototype.compareBuild = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString$1.call(value); + var i = 0 + do { + var a = this.build[i] + var b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) } -/** `Object#toString` result references. */ -var nullTag = '[object Null]'; -var undefinedTag = '[object Undefined]'; +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break -/** Built-in value references. */ -var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined; + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; + default: + throw new Error('invalid increment argument: ' + release) } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); + this.format() + this.raw = this.version + return this } -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]'; -var funcTag = '[object Function]'; -var genTag = '[object GeneratorFunction]'; -var proxyTag = '[object Proxy]'; +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - if (!isObject(value)) { - return false; + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } } -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} +exports.compareIdentifiers = compareIdentifiers -// A temporary value used to identify if the loop should be broken. -// See #1064, #1293 -var breakLoop = {}; +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) -/** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} + if (anum && bnum) { + a = +a + b = +b + } -function once(fn) { - return function () { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, arguments); - }; + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 } -var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator; +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} -var getIterator = function (coll) { - return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol](); -}; +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} - while (++index < n) { - result[index] = iteratee(index); - } - return result; +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch } -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) } -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; +exports.compareBuild = compareBuild +function compareBuild (a, b, loose) { + var versionA = new SemVer(a, loose) + var versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) } -/** Used for built-in method references. */ -var objectProto$3 = Object.prototype; +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} -/** Used to check objects for own properties. */ -var hasOwnProperty$2 = objectProto$3.hasOwnProperty; +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) +} -/** Built-in value references. */ -var propertyIsEnumerable = objectProto$3.propertyIsEnumerable; +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 } -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; + case '': + case '=': + case '==': + return eq(a, b, loose) -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER$1 = 9007199254740991; + case '!=': + return neq(a, b, loose) -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER$1 : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); -} + case '>': + return gt(a, b, loose) -/** `Object#toString` result references. */ -var argsTag$1 = '[object Arguments]'; -var arrayTag = '[object Array]'; -var boolTag = '[object Boolean]'; -var dateTag = '[object Date]'; -var errorTag = '[object Error]'; -var funcTag$1 = '[object Function]'; -var mapTag = '[object Map]'; -var numberTag = '[object Number]'; -var objectTag = '[object Object]'; -var regexpTag = '[object RegExp]'; -var setTag = '[object Set]'; -var stringTag = '[object String]'; -var weakMapTag = '[object WeakMap]'; + case '>=': + return gte(a, b, loose) -var arrayBufferTag = '[object ArrayBuffer]'; -var dataViewTag = '[object DataView]'; -var float32Tag = '[object Float32Array]'; -var float64Tag = '[object Float64Array]'; -var int8Tag = '[object Int8Array]'; -var int16Tag = '[object Int16Array]'; -var int32Tag = '[object Int32Array]'; -var uint8Tag = '[object Uint8Array]'; -var uint8ClampedTag = '[object Uint8ClampedArray]'; -var uint16Tag = '[object Uint16Array]'; -var uint32Tag = '[object Uint32Array]'; + case '<': + return lt(a, b, loose) -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; + case '<=': + return lte(a, b, loose) -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + default: + throw new TypeError('Invalid operator: ' + op) + } } -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } -/** Detect free variable `exports`. */ -var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports; + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } -/** Detect free variable `module`. */ -var freeModule$1 = freeExports$1 && "object" == 'object' && module && !module.nodeType && module; + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports$1 && freeGlobal.process; + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types; + debug('comp', this) +} - if (types) { - return types; - } +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var m = comp.match(r) - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} -/** Used for built-in method references. */ -var objectProto$2 = Object.prototype; +Comparator.prototype.toString = function () { + return this.value +} -/** Used to check objects for own properties. */ -var hasOwnProperty$1 = objectProto$2.hasOwnProperty; +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; + if (this.semver === ANY || version === ANY) { + return true + } - for (var key in value) { - if ((inherited || hasOwnProperty$1.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false } } - return result; -} - -/** Used for built-in method references. */ -var objectProto$5 = Object.prototype; - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5; - return value === proto; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; + return cmp(version, this.operator, this.semver, this.options) } -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } -/** Used for built-in method references. */ -var objectProto$4 = Object.prototype; + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } -/** Used to check objects for own properties. */ -var hasOwnProperty$3 = objectProto$4.hasOwnProperty; + var rangeTmp -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty$3.call(object, key) && key != 'constructor') { - result.push(key); + if (this.operator === '') { + if (this.value === '') { + return true } + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) } - return result; -} -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) -function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? {value: coll[i], key: i} : null; - } + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan } -function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) - return null; - i++; - return {value: item.value, key: i}; +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false } -} - -function createObjectIterator(obj) { - var okeys = keys(obj); - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - return i < len ? {value: obj[key], key: key} : null; - }; -} + } -function iterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) } + } - var iterator = getIterator(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); -} + if (range instanceof Comparator) { + return new Range(range.value, options) + } -function onlyOnce(fn) { - return function() { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, arguments); - }; -} + if (!(this instanceof Range)) { + return new Range(range, options) + } -function _eachOfLimit(limit) { - return function (obj, iteratee, callback) { - callback = once(callback || noop); - if (limit <= 0 || !obj) { - return callback(null); - } - var nextElem = iterator(obj); - var done = false; - var running = 0; - var looping = false; + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease - function iterateeCallback(err, value) { - running -= 1; - if (err) { - done = true; - callback(err); - } - else if (value === breakLoop || (done && running <= 0)) { - done = true; - return callback(null); - } - else if (!looping) { - replenish(); - } - } + // First, split based on boolean or || + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) - function replenish () { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - looping = false; - } + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range) + } - replenish(); - }; + this.format() } -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -function eachOfLimit(coll, limit, iteratee, callback) { - _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range } -function doLimit(fn, limit) { - return function (iterable, iteratee, callback) { - return fn(iterable, limit, iteratee, callback); - }; +Range.prototype.toString = function () { + return this.range } -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback || noop); - var index = 0, - completed = 0, - length = coll.length; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err) { - callback(err); - } else if ((++completed === length) || value === breakLoop) { - callback(null); - } - } +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + range = range.trim() + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) - for (; index < length; index++) { - iteratee(coll[index], index, onlyOnce(iteratorCallback)); - } -} + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) -// a generic version of eachOf which can handle array, object, and iterator cases. -var eachOfGeneric = doLimit(eachOfLimit, Infinity); + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @example - * - * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; - * var configs = {}; - * - * async.forEachOf(obj, function (value, key, callback) { - * fs.readFile(__dirname + value, "utf8", function (err, data) { - * if (err) return callback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * }, function (err) { - * if (err) console.error(err.message); - * // configs is now a map of JSON data - * doSomethingWith(configs); - * }); - */ -var eachOf = function(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - eachOfImplementation(coll, wrapAsync(iteratee), callback); -}; + // normalize spaces + range = range.split(/\s+/).join(' ') -function doParallel(fn) { - return function (obj, iteratee, callback) { - return fn(eachOf, obj, wrapAsync(iteratee), callback); - }; -} + // At this point, the range is completely trimmed and + // ready to be split into comparators. -function _asyncMap(eachfn, arr, iteratee, callback) { - callback = callback || noop; - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); + var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) - eachfn(arr, function (value, _, callback) { - var index = counter++; - _iteratee(value, function (err, v) { - results[index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); + return set } -/** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callback - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @example - * - * async.map(['file1','file2','file3'], fs.stat, function(err, results) { - * // results is now an array of stats for each file - * }); - */ -var map = doParallel(_asyncMap); - -/** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {Function} - If only the first argument, `fns`, is provided, it will - * return a function which lets you pass in the arguments as if it were a single - * function call. The signature is `(..args, callback)`. If invoked with any - * arguments, `callback` is required. - * @example - * - * async.applyEach([enableSearch, updateSchema], 'bucket', callback); - * - * // partial application example: - * async.each( - * buckets, - * async.applyEach([enableSearch, updateSchema]), - * callback - * ); - */ -var applyEach = applyEach$1(map); +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } -function doParallelLimit(fn) { - return function (obj, limit, iteratee, callback) { - return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback); - }; + return this.set.some(function (thisComparators) { + return ( + isSatisfiable(thisComparators, options) && + range.set.some(function (rangeComparators) { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every(function (thisComparator) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) } -/** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - */ -var mapLimit = doParallelLimit(_asyncMap); +// take a set of comparators and determine whether there +// exists a version which can satisfy it +function isSatisfiable (comparators, options) { + var result = true + var remainingComparators = comparators.slice() + var testComparator = remainingComparators.pop() -/** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - */ -var mapSeries = doLimit(mapLimit, 1); + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }) -/** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {Function} - If only the first argument is provided, it will return - * a function which lets you pass in the arguments as if it were a single - * function call. - */ -var applyEachSeries = applyEach$1(mapSeries); + testComparator = remainingComparators.pop() + } -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; + return result +} - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) } -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp } -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') } -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); +function replaceTilde (comp, options) { + var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' } - } - return -1; + + debug('tilde return', ret) + return ret + }) } -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') } -/** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret - while (++index < length) { - if (array[index] === value) { - return index; + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } } - } - return -1; -} -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); + debug('caret return', ret) + return ret + }) } -/** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns undefined - * @example - * - * async.auto({ - * // this function will just be passed a callback - * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'), - * showData: ['readData', function(results, cb) { - * // results.readData is the file's contents - * // ... - * }] - * }, callback); - * - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * console.log('in write_file', JSON.stringify(results)); - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * console.log('in email_link', JSON.stringify(results)); - * // once the file is written let's email a link to it... - * // results.write_file contains the filename returned by write_file. - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * console.log('err = ', err); - * console.log('results = ', results); - * }); - */ -var auto = function (tasks, concurrency, callback) { - if (typeof concurrency === 'function') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = once(callback || noop); - var keys$$1 = keys(tasks); - var numTasks = keys$$1.length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} - var results = {}; - var runningTasks = 0; - var hasError = false; +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp - var listeners = Object.create(null); + if (gtlt === '=' && anyX) { + gtlt = '' + } - var readyTasks = []; + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 - baseForOwn(tasks, function (task, key) { - if (!isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 } - - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 } - uncheckedDependencies[key] = remainingDependencies; - - arrayEach(dependencies, function (dependencyName) { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + - '` has a non-existent dependency `' + - dependencyName + '` in ' + - dependencies.join(', ')); - } - addListener(dependencyName, function () { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - - checkForDeadlocks(); - processQueue(); + } - function enqueueTask(key, task) { - readyTasks.push(function () { - runTask(key, task); - }); + ret = gtlt + M + '.' + m + '.' + p + pr + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr } - function processQueue() { - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while(readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } + debug('xRange return', ret) - } + return ret + }) +} - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], '') +} - taskListeners.push(fn); - } +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - arrayEach(taskListeners, function (fn) { - fn(); - }); - processQueue(); - } + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + return (from + ' ' + to).trim() +} - function runTask(key, task) { - if (hasError) return; +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } - var taskCallback = onlyOnce(function(err, result) { - runningTasks--; - if (arguments.length > 2) { - result = slice(arguments, 1); - } - if (err) { - var safeResults = {}; - baseForOwn(results, function(val, rkey) { - safeResults[rkey] = val; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false } + } - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - arrayEach(getDependents(currentTask), function (dependent) { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } - if (counter !== numTasks) { - throw new Error( - 'async.auto cannot execute tasks due to a recursive dependency' - ); + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true } + } } - function getDependents(taskName) { - var result = []; - baseForOwn(tasks, function (task, key) { - if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) { - result.push(key); - } - }); - return result; - } -}; + // Version has a -pre, but it's not one of the ones we like. + return false + } -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); + return true +} - while (++index < length) { - result[index] = iteratee(array[index], index, array); +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false } - return result; + return range.test(version) } -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max } -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; -var symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min } -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver } - return result; -} -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] -/** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ -function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; + return null } -/** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ -function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) } -/** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function asciiToArray(string) { - return string.split(''); +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) } -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff'; -var rsComboMarksRange = '\\u0300-\\u036f'; -var reComboHalfMarksRange = '\\ufe20-\\ufe2f'; -var rsComboSymbolsRange = '\\u20d0-\\u20ff'; -var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; -var rsVarRange = '\\ufe0e\\ufe0f'; +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } -/** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ -function hasUnicode(string) { - return reHasUnicode.test(string); -} - -/** Used to compose unicode character classes. */ -var rsAstralRange$1 = '\\ud800-\\udfff'; -var rsComboMarksRange$1 = '\\u0300-\\u036f'; -var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f'; -var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff'; -var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1; -var rsVarRange$1 = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange$1 + ']'; -var rsCombo = '[' + rsComboRange$1 + ']'; -var rsFitz = '\\ud83c[\\udffb-\\udfff]'; -var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; -var rsNonAstral = '[^' + rsAstralRange$1 + ']'; -var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; -var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; -var rsZWJ$1 = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?'; -var rsOptVar = '[' + rsVarRange$1 + ']?'; -var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; -var rsSeq = rsOptVar + reOptMod + rsOptJoin; -var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. -/** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function unicodeToArray(string) { - return string.match(reUnicode) || []; -} + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); -} + var high = null + var low = null -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } -/** - * Removes leading and trailing whitespace or specified characters from `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the trimmed string. - * @example - * - * _.trim(' abc '); - * // => 'abc' - * - * _.trim('-_-abc-_-', '_-'); - * // => 'abc' - * - * _.map([' foo ', ' bar '], _.trim); - * // => ['foo', 'bar'] - */ -function trim(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined)) { - return string.replace(reTrim, ''); - } - if (!string || !(chars = baseToString(chars))) { - return string; + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } } - var strSymbols = stringToArray(string), - chrSymbols = stringToArray(chars), - start = charsStartIndex(strSymbols, chrSymbols), - end = charsEndIndex(strSymbols, chrSymbols) + 1; - - return castSlice(strSymbols, start, end).join(''); + return true } -var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m; -var FN_ARG_SPLIT = /,/; -var FN_ARG = /(=.+)?(\s*)$/; -var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} -function parseParams(func) { - func = func.toString().replace(STRIP_COMMENTS, ''); - func = func.match(FN_ARGS)[2].replace(' ', ''); - func = func ? func.split(FN_ARG_SPLIT) : []; - func = func.map(function (arg){ - return trim(arg.replace(FN_ARG, '')); - }); - return func; +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) } -/** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ -function autoInject(tasks, callback) { - var newTasks = {}; - - baseForOwn(tasks, function (taskFn, key) { - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = - (!fnIsAsync && taskFn.length === 1) || - (fnIsAsync && taskFn.length === 0); - - if (isArray(taskFn)) { - params = taskFn.slice(0, -1); - taskFn = taskFn[taskFn.length - 1]; - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } +exports.coerce = coerce +function coerce (version, options) { + if (version instanceof SemVer) { + return version + } - // remove callback param - if (!fnIsAsync) params.pop(); + if (typeof version === 'number') { + version = String(version) + } - newTasks[key] = params.concat(newTask); - } + if (typeof version !== 'string') { + return null + } - function newTask(results, taskCb) { - var newArgs = arrayMap(params, function (name) { - return results[name]; - }); - newArgs.push(taskCb); - wrapAsync(taskFn).apply(null, newArgs); - } - }); + options = options || {} - auto(newTasks, callback); -} + var match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } -// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation -// used for queues. This implementation assumes that the node provided by the user can be modified -// to adjust the next and last properties. We implement only the minimal functionality -// for queue support. -function DLL() { - this.head = this.tail = null; - this.length = 0; -} + if (match === null) { + return null + } -function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) } -DLL.prototype.removeLink = function(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; - node.prev = node.next = null; - this.length -= 1; - return node; -}; +/***/ }), -DLL.prototype.empty = function () { - while(this.head) this.shift(); - return this; -}; +/***/ 24437: +/***/ ((__unused_webpack_module, exports) => { -DLL.prototype.insertAfter = function(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; -}; +"use strict"; -DLL.prototype.insertBefore = function(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; -}; -DLL.prototype.unshift = function(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); -}; +exports.E = function (fn) { + return Object.defineProperty(function () { + if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) + else { + return new Promise((resolve, reject) => { + arguments[arguments.length] = (err, res) => { + if (err) return reject(err) + resolve(res) + } + arguments.length++ + fn.apply(this, arguments) + }) + } + }, 'name', { value: fn.name }) +} -DLL.prototype.push = function(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); -}; +exports.p = function (fn) { + return Object.defineProperty(function () { + const cb = arguments[arguments.length - 1] + if (typeof cb !== 'function') return fn.apply(this, arguments) + else fn.apply(this, arguments).then(r => cb(null, r), cb) + }, 'name', { value: fn.name }) +} -DLL.prototype.shift = function() { - return this.head && this.removeLink(this.head); -}; -DLL.prototype.pop = function() { - return this.tail && this.removeLink(this.tail); -}; +/***/ }), -DLL.prototype.toArray = function () { - var arr = Array(this.length); - var curr = this.head; - for(var idx = 0; idx < this.length; idx++) { - arr[idx] = curr.data; - curr = curr.next; - } - return arr; -}; +/***/ 24120: +/***/ ((module, exports, __nccwpck_require__) => { -DLL.prototype.remove = function (testFn) { - var curr = this.head; - while(!!curr) { - var next = curr.next; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; +"use strict"; + +/// +/// +/// +/// +Object.defineProperty(exports, "__esModule", ({ value: true })); +// TODO: Use the `URL` global when targeting Node.js 10 +// tslint:disable-next-line +const URLGlobal = typeof URL === 'undefined' ? __nccwpck_require__(78835).URL : URL; +const toString = Object.prototype.toString; +const isOfType = (type) => (value) => typeof value === type; +const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input); +const getObjectType = (value) => { + const objectName = toString.call(value).slice(8, -1); + if (objectName) { + return objectName; } - return this; + return null; }; - -function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; +const isObjectOfType = (type) => (value) => getObjectType(value) === type; +function is(value) { + switch (value) { + case null: + return "null" /* null */; + case true: + case false: + return "boolean" /* boolean */; + default: } - else if(concurrency === 0) { - throw new Error('Concurrency must not be zero'); + switch (typeof value) { + case 'undefined': + return "undefined" /* undefined */; + case 'string': + return "string" /* string */; + case 'number': + return "number" /* number */; + case 'symbol': + return "symbol" /* symbol */; + default: } - - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; - - var processingScheduled = false; - function _insert(data, insertAtFront, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); + if (is.function_(value)) { + return "Function" /* Function */; + } + if (is.observable(value)) { + return "Observable" /* Observable */; + } + if (Array.isArray(value)) { + return "Array" /* Array */; + } + if (isBuffer(value)) { + return "Buffer" /* Buffer */; + } + const tagType = getObjectType(value); + if (tagType) { + return tagType; + } + if (value instanceof String || value instanceof Boolean || value instanceof Number) { + throw new TypeError('Please don\'t use object wrappers for primitive types'); + } + return "Object" /* Object */; +} +(function (is) { + // tslint:disable-next-line:strict-type-predicates + const isObject = (value) => typeof value === 'object'; + // tslint:disable:variable-name + is.undefined = isOfType('undefined'); + is.string = isOfType('string'); + is.number = isOfType('number'); + is.function_ = isOfType('function'); + // tslint:disable-next-line:strict-type-predicates + is.null_ = (value) => value === null; + is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); + is.boolean = (value) => value === true || value === false; + is.symbol = isOfType('symbol'); + // tslint:enable:variable-name + is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value)); + is.array = Array.isArray; + is.buffer = isBuffer; + is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); + is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value)); + is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]); + is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]); + is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); + is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value); + const hasPromiseAPI = (value) => !is.null_(value) && + isObject(value) && + is.function_(value.then) && + is.function_(value.catch); + is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); + is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */); + is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */); + is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); + is.regExp = isObjectOfType("RegExp" /* RegExp */); + is.date = isObjectOfType("Date" /* Date */); + is.error = isObjectOfType("Error" /* Error */); + is.map = (value) => isObjectOfType("Map" /* Map */)(value); + is.set = (value) => isObjectOfType("Set" /* Set */)(value); + is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value); + is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value); + is.int8Array = isObjectOfType("Int8Array" /* Int8Array */); + is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */); + is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */); + is.int16Array = isObjectOfType("Int16Array" /* Int16Array */); + is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */); + is.int32Array = isObjectOfType("Int32Array" /* Int32Array */); + is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */); + is.float32Array = isObjectOfType("Float32Array" /* Float32Array */); + is.float64Array = isObjectOfType("Float64Array" /* Float64Array */); + is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */); + is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */); + is.dataView = isObjectOfType("DataView" /* DataView */); + is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype; + is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value); + is.urlString = (value) => { + if (!is.string(value)) { + return false; } - q.started = true; - if (!isArray(data)) { - data = [data]; + try { + new URLGlobal(value); // tslint:disable-line no-unused-expression + return true; } - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - return setImmediate$1(function() { - q.drain(); - }); + catch (_a) { + return false; } - - for (var i = 0, l = data.length; i < l; i++) { - var item = { - data: data[i], - callback: callback || noop - }; - - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } + }; + is.truthy = (value) => Boolean(value); + is.falsy = (value) => !value; + is.nan = (value) => Number.isNaN(value); + const primitiveTypes = new Set([ + 'undefined', + 'string', + 'number', + 'boolean', + 'symbol' + ]); + is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value); + is.integer = (value) => Number.isInteger(value); + is.safeInteger = (value) => Number.isSafeInteger(value); + is.plainObject = (value) => { + // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js + let prototype; + return getObjectType(value) === "Object" /* Object */ && + (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator + prototype === Object.getPrototypeOf({})); + }; + const typedArrayTypes = new Set([ + "Int8Array" /* Int8Array */, + "Uint8Array" /* Uint8Array */, + "Uint8ClampedArray" /* Uint8ClampedArray */, + "Int16Array" /* Int16Array */, + "Uint16Array" /* Uint16Array */, + "Int32Array" /* Int32Array */, + "Uint32Array" /* Uint32Array */, + "Float32Array" /* Float32Array */, + "Float64Array" /* Float64Array */ + ]); + is.typedArray = (value) => { + const objectType = getObjectType(value); + if (objectType === null) { + return false; } - - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(function() { - processingScheduled = false; - q.process(); - }); + return typedArrayTypes.has(objectType); + }; + const isValidLength = (value) => is.safeInteger(value) && value > -1; + is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); + is.inRange = (value, range) => { + if (is.number(range)) { + return value >= Math.min(0, range) && value <= Math.max(range, 0); } - } - - function _next(tasks) { - return function(err){ - numRunning -= 1; - - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - - var index = baseIndexOf(workersList, task, 0); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } - - task.callback.apply(task, arguments); - - if (err != null) { - q.error(err, task.data); - } - } - - if (numRunning <= (q.concurrency - q.buffer) ) { - q.unsaturated(); - } - - if (q.idle()) { - q.drain(); - } - q.process(); - }; - } - - var isProcessing = false; - var q = { - _tasks: new DLL(), - concurrency: concurrency, - payload: payload, - saturated: noop, - unsaturated:noop, - buffer: concurrency / 4, - empty: noop, - drain: noop, - error: noop, - started: false, - paused: false, - push: function (data, callback) { - _insert(data, false, callback); - }, - kill: function () { - q.drain = noop; - q._tasks.empty(); - }, - unshift: function (data, callback) { - _insert(data, true, callback); - }, - remove: function (testFn) { - q._tasks.remove(testFn); - }, - process: function () { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while(!q.paused && numRunning < q.concurrency && q._tasks.length){ - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - - numRunning += 1; - - if (q._tasks.length === 0) { - q.empty(); - } - - if (numRunning === q.concurrency) { - q.saturated(); - } - - var cb = onlyOnce(_next(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length: function () { - return q._tasks.length; - }, - running: function () { - return numRunning; - }, - workersList: function () { - return workersList; - }, - idle: function() { - return q._tasks.length + numRunning === 0; - }, - pause: function () { - q.paused = true; - }, - resume: function () { - if (q.paused === false) { return; } - q.paused = false; - setImmediate$1(q.process); + if (is.array(range) && range.length === 2) { + return value >= Math.min(...range) && value <= Math.max(...range); } + throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); }; - return q; -} - -/** - * A cargo of tasks for the worker function to complete. Cargo inherits all of - * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}. - * @typedef {Object} CargoObject - * @memberOf module:ControlFlow - * @property {Function} length - A function returning the number of items - * waiting to be processed. Invoke like `cargo.length()`. - * @property {number} payload - An `integer` for determining how many tasks - * should be process per round. This property can be changed after a `cargo` is - * created to alter the payload on-the-fly. - * @property {Function} push - Adds `task` to the `queue`. The callback is - * called once the `worker` has finished processing the task. Instead of a - * single task, an array of `tasks` can be submitted. The respective callback is - * used for every task in the list. Invoke like `cargo.push(task, [callback])`. - * @property {Function} saturated - A callback that is called when the - * `queue.length()` hits the concurrency and further tasks will be queued. - * @property {Function} empty - A callback that is called when the last item - * from the `queue` is given to a `worker`. - * @property {Function} drain - A callback that is called when the last item - * from the `queue` has returned from the `worker`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke like `cargo.idle()`. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke like `cargo.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke like `cargo.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`. - */ - -/** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && + !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); + is.observable = (value) => { + if (!value) { + return false; } - - reduce(_functions, args, function(newargs, fn, cb) { - fn.apply(that, newargs.concat(function(err/*, ...nextargs*/) { - var nextargs = slice(arguments, 1); - cb(err, nextargs); - })); - }, - function(err, results) { - cb.apply(that, [err].concat(results)); - }); + if (value[Symbol.observable] && value === value[Symbol.observable]()) { + return true; + } + if (value['@@observable'] && value === value['@@observable']()) { + return true; + } + return false; }; -} - -/** - * Creates a function which is a composition of the passed asynchronous - * functions. Each function consumes the return value of the function that - * follows. Composing functions `f()`, `g()`, and `h()` would produce the result - * of `f(g(h()))`, only this version uses callbacks to obtain the return values. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name compose - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} an asynchronous function that is the composed - * asynchronous `functions` - * @example - * - * function add1(n, callback) { - * setTimeout(function () { - * callback(null, n + 1); - * }, 10); - * } - * - * function mul3(n, callback) { - * setTimeout(function () { - * callback(null, n * 3); - * }, 10); - * } - * - * var add1mul3 = async.compose(mul3, add1); - * add1mul3(4, function (err, result) { - * // result now equals 15 - * }); - */ -var compose = function(/*...args*/) { - return seq.apply(null, slice(arguments).reverse()); -}; - -var _concat = Array.prototype.concat; - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - */ -var concatLimit = function(coll, limit, iteratee, callback) { - callback = callback || noop; - var _iteratee = wrapAsync(iteratee); - mapLimit(coll, limit, function(val, callback) { - _iteratee(val, function(err /*, ...args*/) { - if (err) return callback(err); - return callback(null, slice(arguments, 1)); - }); - }, function(err, mapResults) { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = _concat.apply(result, mapResults[i]); - } + is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value); + is.infinite = (value) => value === Infinity || value === -Infinity; + const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem; + is.even = isAbsoluteMod2(0); + is.odd = isAbsoluteMod2(1); + const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false; + is.emptyArray = (value) => is.array(value) && value.length === 0; + is.nonEmptyArray = (value) => is.array(value) && value.length > 0; + is.emptyString = (value) => is.string(value) && value.length === 0; + is.nonEmptyString = (value) => is.string(value) && value.length > 0; + is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); + is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; + is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; + is.emptySet = (value) => is.set(value) && value.size === 0; + is.nonEmptySet = (value) => is.set(value) && value.size > 0; + is.emptyMap = (value) => is.map(value) && value.size === 0; + is.nonEmptyMap = (value) => is.map(value) && value.size > 0; + const predicateOnArray = (method, predicate, values) => { + if (is.function_(predicate) === false) { + throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); } - - return callback(err, result); - }); -}; - -/** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. There is no guarantee that the - * results array will be returned in the original order of `coll` passed to the - * `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback(err)] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @example - * - * async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) { - * // files is now a list of filenames that exist in the 3 directories - * }); - */ -var concat = doLimit(concatLimit, Infinity); - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback(err)] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - */ -var concatSeries = doLimit(concatLimit, 1); - -/** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ -var constant = function(/*...values*/) { - var values = slice(arguments); - var args = [null].concat(values); - return function (/*...ignoredArgs, callback*/) { - var callback = arguments[arguments.length - 1]; - return callback.apply(this, args); + if (values.length === 0) { + throw new TypeError('Invalid number of values'); + } + return method.call(values, predicate); }; -}; + // tslint:disable variable-name + is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values); + is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); + // tslint:enable variable-name +})(is || (is = {})); +// Some few keywords are reserved, but we'll populate them for Node.js users +// See https://github.com/Microsoft/TypeScript/issues/2536 +Object.defineProperties(is, { + class: { + value: is.class_ + }, + function: { + value: is.function_ + }, + null: { + value: is.null_ + } +}); +exports.default = is; +// For CommonJS default export support +module.exports = is; +module.exports.default = is; +//# sourceMappingURL=index.js.map -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} +/***/ }), -function _createTester(check, getResult) { - return function(eachfn, arr, iteratee, cb) { - cb = cb || noop; - var testPassed = false; - var testResult; - eachfn(arr, function(value, _, callback) { - iteratee(value, function(err, result) { - if (err) { - callback(err); - } else if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - callback(null, breakLoop); - } else { - callback(); - } - }); - }, function(err) { - if (err) { - cb(err); - } else { - cb(null, testPassed ? testResult : getResult(false)); - } - }); - }; -} +/***/ 8595: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function _findGetResult(v, x) { - return x; -} +"use strict"; -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @example - * - * async.detect(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // result now equals the first file in the list that exists - * }); - */ -var detect = doParallel(_createTester(identity, _findGetResult)); +const deferToConnect = __nccwpck_require__(12097); -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - */ -var detectLimit = doParallelLimit(_createTester(identity, _findGetResult)); +module.exports = request => { + const timings = { + start: Date.now(), + socket: null, + lookup: null, + connect: null, + upload: null, + response: null, + end: null, + error: null, + phases: { + wait: null, + dns: null, + tcp: null, + request: null, + firstByte: null, + download: null, + total: null + } + }; -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - */ -var detectSeries = doLimit(detectLimit, 1); - -function consoleFunc(name) { - return function (fn/*, ...args*/) { - var args = slice(arguments, 1); - args.push(function (err/*, ...args*/) { - var args = slice(arguments, 1); - if (typeof console === 'object') { - if (err) { - if (console.error) { - console.error(err); - } - } else if (console[name]) { - arrayEach(args, function (x) { - console[name](x); - }); - } - } - }); - wrapAsync(fn).apply(null, args); - }; -} + const handleError = origin => { + const emit = origin.emit.bind(origin); + origin.emit = (event, ...args) => { + // Catches the `error` event + if (event === 'error') { + timings.error = Date.now(); + timings.phases.total = timings.error - timings.start; -/** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ -var dir = consoleFunc('dir'); + origin.emit = emit; + } -/** - * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in - * the order of operations, the arguments `test` and `fn` are switched. - * - * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function. - * @name doDuring - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.during]{@link module:ControlFlow.during} - * @category Control Flow - * @param {AsyncFunction} fn - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `fn`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `fn`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `fn` has stopped. `callback` - * will be passed an error if one occurred, otherwise `null`. - */ -function doDuring(fn, test, callback) { - callback = onlyOnce(callback || noop); - var _fn = wrapAsync(fn); - var _test = wrapAsync(test); + // Saves the original behavior + return emit(event, ...args); + }; + }; - function next(err/*, ...args*/) { - if (err) return callback(err); - var args = slice(arguments, 1); - args.push(check); - _test.apply(this, args); - } + let uploadFinished = false; + const onUpload = () => { + timings.upload = Date.now(); + timings.phases.request = timings.upload - timings.connect; + }; - function check(err, truth) { - if (err) return callback(err); - if (!truth) return callback(null); - _fn(next); - } + handleError(request); - check(null, true); + request.once('socket', socket => { + timings.socket = Date.now(); + timings.phases.wait = timings.socket - timings.start; -} + const lookupListener = () => { + timings.lookup = Date.now(); + timings.phases.dns = timings.lookup - timings.socket; + }; -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {Function} test - synchronous truth test to perform after each - * execution of `iteratee`. Invoked with any non-error callback results of - * `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - */ -function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback || noop); - var _iteratee = wrapAsync(iteratee); - var next = function(err/*, ...args*/) { - if (err) return callback(err); - var args = slice(arguments, 1); - if (test.apply(this, args)) return _iteratee(next); - callback.apply(null, [null].concat(args)); - }; - _iteratee(next); -} + socket.once('lookup', lookupListener); -/** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} test - synchronous truth test to perform after each - * execution of `iteratee`. Invoked with any non-error callback results of - * `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - */ -function doUntil(iteratee, test, callback) { - doWhilst(iteratee, function() { - return !test.apply(this, arguments); - }, callback); -} + deferToConnect(socket, () => { + timings.connect = Date.now(); -/** - * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that - * is passed a callback in the form of `function (err, truth)`. If error is - * passed to `test` or `fn`, the main callback is immediately called with the - * value of the error. - * - * @name during - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `fn`. Invoked with (callback). - * @param {AsyncFunction} fn - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `fn` has stopped. `callback` - * will be passed an error, if one occurred, otherwise `null`. - * @example - * - * var count = 0; - * - * async.during( - * function (callback) { - * return callback(null, count < 5); - * }, - * function (callback) { - * count++; - * setTimeout(callback, 1000); - * }, - * function (err) { - * // 5 seconds have passed - * } - * ); - */ -function during(test, fn, callback) { - callback = onlyOnce(callback || noop); - var _fn = wrapAsync(fn); - var _test = wrapAsync(test); + if (timings.lookup === null) { + socket.removeListener('lookup', lookupListener); + timings.lookup = timings.connect; + timings.phases.dns = timings.lookup - timings.socket; + } - function next(err) { - if (err) return callback(err); - _test(check); - } + timings.phases.tcp = timings.connect - timings.lookup; - function check(err, truth) { - if (err) return callback(err); - if (!truth) return callback(null); - _fn(next); - } + if (uploadFinished && !timings.upload) { + onUpload(); + } + }); + }); - _test(check); -} + request.once('finish', () => { + uploadFinished = true; -function _withoutIndex(iteratee) { - return function (value, index, callback) { - return iteratee(value, callback); - }; -} + if (timings.connect) { + onUpload(); + } + }); -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @example - * - * // assuming openFiles is an array of file names and saveFile is a function - * // to save the modified contents of that file: - * - * async.each(openFiles, saveFile, function(err){ - * // if any of the saves produced an error, err would equal that error - * }); - * - * // assuming openFiles is an array of file names - * async.each(openFiles, function(file, callback) { - * - * // Perform operation on file here. - * console.log('Processing file ' + file); - * - * if( file.length > 32 ) { - * console.log('This file name is too long'); - * callback('File name too long'); - * } else { - * // Do work to process file here - * console.log('File processed'); - * callback(); - * } - * }, function(err) { - * // if any of the file processing produced an error, err would equal that error - * if( err ) { - * // One of the iterations produced an error. - * // All processing will now stop. - * console.log('A file failed to process'); - * } else { - * console.log('All files have been processed successfully'); - * } - * }); - */ -function eachLimit(coll, iteratee, callback) { - eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} + request.once('response', response => { + timings.response = Date.now(); + timings.phases.firstByte = timings.response - timings.upload; -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -function eachLimit$1(coll, limit, iteratee, callback) { - _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} + handleError(response); -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -var eachSeries = doLimit(eachLimit$1, 1); + response.once('end', () => { + timings.end = Date.now(); + timings.phases.download = timings.end - timings.response; + timings.phases.total = timings.end - timings.start; + }); + }); -/** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ -function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return initialParams(function (args, callback) { - var sync = true; - args.push(function () { - var innerArgs = arguments; - if (sync) { - setImmediate$1(function () { - callback.apply(null, innerArgs); - }); - } else { - callback.apply(null, innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }); -} + return timings; +}; -function notId(v) { - return !v; -} -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @example - * - * async.every(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // if result is true then every file exists - * }); - */ -var every = doParallel(_createTester(notId, notId)); +/***/ }), -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - */ -var everyLimit = doParallelLimit(_createTester(notId, notId)); +/***/ 58588: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - */ -var everySeries = doLimit(everyLimit, 1); +"use strict"; +/* module decorator */ module = __nccwpck_require__.nmd(module); -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} -function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, function (x, index, callback) { - iteratee(x, function (err, v) { - truthValues[index] = !!v; - callback(err); - }); - }, function (err) { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); -} +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; -function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, function (x, index, callback) { - iteratee(x, function (err, v) { - if (err) { - callback(err); - } else { - if (v) { - results.push({index: index, value: x}); - } - callback(); - } - }); - }, function (err) { - if (err) { - callback(err); - } else { - callback(null, arrayMap(results.sort(function (a, b) { - return a.index - b.index; - }), baseProperty('value'))); - } - }); -} +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; -function _filter(eachfn, coll, iteratee, callback) { - var filter = isArrayLike(coll) ? filterArray : filterGeneric; - filter(eachfn, coll, wrapAsync(iteratee), callback || noop); -} +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @example - * - * async.filter(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, results) { - * // results now equals an array of the existing files - * }); - */ -var filter = doParallel(_filter); +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var filterLimit = doParallelLimit(_filter); +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - */ -var filterSeries = doLimit(filterLimit, 1); + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); -/** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. + return value; + }, + enumerable: true, + configurable: true + }); +}; - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ -function forever(fn, errback) { - var done = onlyOnce(errback || noop); - var task = wrapAsync(ensureAsync(fn)); +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = __nccwpck_require__(73991); + } - function next(err) { - if (err) return done(err); - task(next); - } - next(); -} + const offset = isBackground ? 10 : 0; + const styles = {}; -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - */ -var groupByLimit = function(coll, limit, iteratee, callback) { - callback = callback || noop; - var _iteratee = wrapAsync(iteratee); - mapLimit(coll, limit, function(val, callback) { - _iteratee(val, function(err, key) { - if (err) return callback(err); - return callback(null, {key: key, val: val}); - }); - }, function(err, mapResults) { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var hasOwnProperty = Object.prototype.hasOwnProperty; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var key = mapResults[i].key; - var val = mapResults[i].val; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } - return callback(err, result); - }); + return styles; }; -/** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @example - * - * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) { - * db.findById(userId, function(err, user) { - * if (err) return callback(err); - * return callback(null, user.age); - * }); - * }, function(err, result) { - * // result is object containing the userIds grouped by age - * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']}; - * }); - */ -var groupBy = doLimit(groupByLimit, Infinity); - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - */ -var groupBySeries = doLimit(groupByLimit, 1); - -/** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ -var log = consoleFunc('log'); - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - */ -function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback || noop); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - eachOfLimit(obj, limit, function(val, key, next) { - _iteratee(val, key, function (err, result) { - if (err) return next(err); - newObj[key] = result; - next(); - }); - }, function (err) { - callback(err, newObj); - }); -} +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + 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], -/** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @example - * - * async.mapValues({ - * f1: 'file1', - * f2: 'file2', - * f3: 'file3' - * }, function (file, key, callback) { - * fs.stat(file, callback); - * }, function(err, result) { - * // result is now a map of stats for each file, e.g. - * // { - * // f1: [stats for file1], - * // f2: [stats for file2], - * // f3: [stats for file3] - * // } - * }); - */ + // Bright color + 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], -var mapValues = doLimit(mapValuesLimit, Infinity); + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - */ -var mapValuesSeries = doLimit(mapValuesLimit, 1); + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; -function has(obj, key) { - return key in obj; -} + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; -/** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ -function memoize(fn, hasher) { - var memo = Object.create(null); - var queues = Object.create(null); - hasher = hasher || identity; - var _fn = wrapAsync(fn); - var memoized = initialParams(function memoized(args, callback) { - var key = hasher.apply(null, args); - if (has(memo, key)) { - setImmediate$1(function() { - callback.apply(null, memo[key]); - }); - } else if (has(queues, key)) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn.apply(null, args.concat(function(/*args*/) { - var args = slice(arguments); - memo[key] = args; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, args); - } - })); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; -} + group[styleName] = styles[styleName]; -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -var _defer$1; + codes.set(style[0], style[1]); + } -if (hasNextTick) { - _defer$1 = process.nextTick; -} else if (hasSetImmediate) { - _defer$1 = setImmediate; -} else { - _defer$1 = fallback; -} + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } -var nextTick = wrap(_defer$1); + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); -function _parallel(eachfn, tasks, callback) { - callback = callback || noop; - var results = isArrayLike(tasks) ? [] : {}; + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; - eachfn(tasks, function (task, key, callback) { - wrapAsync(task)(function (err, result) { - if (arguments.length > 2) { - result = slice(arguments, 1); - } - results[key] = result; - callback(err); - }); - }, function (err) { - callback(err, results); - }); -} + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); -/** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * - * @example - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // optional callback - * function(err, results) { - * // the results array will equal ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * // results is now equals to: {one: 1, two: 2} - * }); - */ -function parallelLimit(tasks, callback) { - _parallel(eachOf, tasks, callback); + return styles; } -/** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - */ -function parallelLimit$1(tasks, limit, callback) { - _parallel(_eachOfLimit(limit), tasks, callback); +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); + + +/***/ }), + +/***/ 898: +/***/ ((module) => { + +module.exports = r => { + const n = process.versions.node.split('.').map(x => parseInt(x, 10)) + r = r.split('.').map(x => parseInt(x, 10)) + return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2]))) } -/** - * A queue of tasks for the worker function to complete. - * @typedef {Object} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {Function} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {Function} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a callback that is called when the number of - * running workers hits the `concurrency` limit, and further tasks will be - * queued. - * @property {Function} unsaturated - a callback that is called when the number - * of running workers is less than the `concurrency` & `buffer` limits, and - * further tasks will not be queued. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a callback that is called when the last item - * from the `queue` is given to a `worker`. - * @property {Function} drain - a callback that is called when the last item - * from the `queue` has returned from the `worker`. - * @property {Function} error - a callback that is called when a task errors. - * Has the signature `function(error, task)`. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - */ -/** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain = function() { - * console.log('all items have been processed'); - * }; - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * q.push({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ -var queue$1 = function (worker, concurrency) { - var _worker = wrapAsync(worker); - return queue(function (items, cb) { - _worker(items[0], cb); - }, concurrency, 1); -}; +/***/ }), -/** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * The `unshift` method was removed. - */ -var priorityQueue = function(worker, concurrency) { - // Start with a normal queue - var q = queue$1(worker, concurrency); - - // Override push to accept second parameter representing priority - q.push = function(data, priority, callback) { - if (callback == null) callback = noop; - if (typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - if (!isArray(data)) { - data = [data]; - } - if (data.length === 0) { - // call drain immediately if there are no tasks - return setImmediate$1(function() { - q.drain(); - }); - } +/***/ 19628: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - priority = priority || 0; - var nextNode = q._tasks.head; - while (nextNode && priority >= nextNode.priority) { - nextNode = nextNode.next; - } +"use strict"; - for (var i = 0, l = data.length; i < l; i++) { - var item = { - data: data[i], - priority: priority, - callback: callback - }; - if (nextNode) { - q._tasks.insertBefore(nextNode, item); - } else { - q._tasks.push(item); - } - } - setImmediate$1(q.process); - }; +const { Buffer } = __nccwpck_require__(64293) +const symbol = Symbol.for('BufferList') - // Remove unshift function - delete q.unshift; +function BufferList (buf) { + if (!(this instanceof BufferList)) { + return new BufferList(buf) + } - return q; -}; + BufferList._init.call(this, buf) +} -/** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns undefined - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ -function race(tasks, callback) { - callback = once(callback || noop); - if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); - } +BufferList._init = function _init (buf) { + Object.defineProperty(this, symbol, { value: true }) + + this._bufs = [] + this.length = 0 + + if (buf) { + this.append(buf) + } } -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee complete with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - */ -function reduceRight (array, memo, iteratee, callback) { - var reversed = slice(array).reverse(); - reduce(reversed, memo, iteratee, callback); +BufferList.prototype._new = function _new (buf) { + return new BufferList(buf) } -/** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ -function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push(function callback(error, cbArg) { - if (error) { - reflectCallback(null, { error: error }); - } else { - var value; - if (arguments.length <= 2) { - value = cbArg; - } else { - value = slice(arguments, 1); - } - reflectCallback(null, { value: value }); - } - }); +BufferList.prototype._offset = function _offset (offset) { + if (offset === 0) { + return [0, 0] + } - return _fn.apply(this, args); - }); -} + let tot = 0 -/** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ -function reflectAll(tasks) { - var results; - if (isArray(tasks)) { - results = arrayMap(tasks, reflect); - } else { - results = {}; - baseForOwn(tasks, function(task, key) { - results[key] = reflect.call(this, task); - }); + for (let i = 0; i < this._bufs.length; i++) { + const _t = tot + this._bufs[i].length + if (offset < _t || i === this._bufs.length - 1) { + return [i, offset - tot] } - return results; + tot = _t + } } -function reject$1(eachfn, arr, iteratee, callback) { - _filter(eachfn, arr, function(value, cb) { - iteratee(value, function(err, v) { - cb(err, !v); - }); - }, callback); +BufferList.prototype._reverseOffset = function (blOffset) { + const bufferId = blOffset[0] + let offset = blOffset[1] + + for (let i = 0; i < bufferId; i++) { + offset += this._bufs[i].length + } + + return offset } -/** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @example - * - * async.reject(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, results) { - * // results now equals an array of missing files - * createFiles(results); - * }); - */ -var reject = doParallel(reject$1); +BufferList.prototype.get = function get (index) { + if (index > this.length || index < 0) { + return undefined + } -/** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var rejectLimit = doParallelLimit(reject$1); + const offset = this._offset(index) -/** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var rejectSeries = doLimit(rejectLimit, 1); + return this._bufs[offset[0]][offset[1]] +} -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ -function constant$1(value) { - return function() { - return value; - }; +BufferList.prototype.slice = function slice (start, end) { + if (typeof start === 'number' && start < 0) { + start += this.length + } + + if (typeof end === 'number' && end < 0) { + end += this.length + } + + return this.copy(null, 0, start, end) } -/** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ -function retry(opts, task, callback) { - var DEFAULT_TIMES = 5; - var DEFAULT_INTERVAL = 0; +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart !== 'number' || srcStart < 0) { + srcStart = 0 + } - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) - }; + if (typeof srcEnd !== 'number' || srcEnd > this.length) { + srcEnd = this.length + } + + if (srcStart >= this.length) { + return dst || Buffer.alloc(0) + } - function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; + if (srcEnd <= 0) { + return dst || Buffer.alloc(0) + } - acc.intervalFunc = typeof t.interval === 'function' ? - t.interval : - constant$1(+t.interval || DEFAULT_INTERVAL); + const copy = !!dst + const off = this._offset(srcStart) + const len = srcEnd - srcStart + let bytes = len + let bufoff = (copy && dstStart) || 0 + let start = off[1] - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } + // copy/slice everything + if (srcStart === 0 && srcEnd === this.length) { + if (!copy) { + // slice, but full concat if multiple buffers + return this._bufs.length === 1 + ? this._bufs[0] + : Buffer.concat(this._bufs, this.length) } - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || noop; - task = opts; - } else { - parseTimes(options, opts); - callback = callback || noop; + // copy, need to copy individual buffers + for (let i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length } - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) { + // a slice, we need something to copy in to + dst = Buffer.allocUnsafe(len) + } + + for (let i = off[0]; i < this._bufs.length; i++) { + const l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + bufoff += l + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + bufoff += l + break } - var _task = wrapAsync(task); + bytes -= l - var attempt = 1; - function retryAttempt() { - _task(function(err) { - if (err && attempt++ < options.times && - (typeof options.errorFilter != 'function' || - options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt)); - } else { - callback.apply(null, arguments); - } - }); + if (start) { + start = 0 } + } + + // safeguard so that we don't return uninitialized memory + if (dst.length > bufoff) return dst.slice(0, bufoff) - retryAttempt(); + return dst } -/** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ -var retryable = function (opts, task) { - if (!task) { - task = opts; - opts = null; - } - var _task = wrapAsync(task); - return initialParams(function (args, callback) { - function taskFn(cb) { - _task.apply(null, args.concat(cb)); - } +BufferList.prototype.shallowSlice = function shallowSlice (start, end) { + start = start || 0 + end = typeof end !== 'number' ? this.length : end - if (opts) retry(opts, taskFn, callback); - else retry(taskFn, callback); + if (start < 0) { + start += this.length + } - }); -}; + if (end < 0) { + end += this.length + } -/** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @example - * async.series([ - * function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }, - * function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * } - * ], - * // optional callback - * function(err, results) { - * // results is now equal to ['one', 'two'] - * }); - * - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback){ - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * // results is now equal to: {one: 1, two: 2} - * }); - */ -function series(tasks, callback) { - _parallel(eachOfSeries, tasks, callback); -} + if (start === end) { + return this._new() + } -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @example - * - * async.some(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // if result is true then at least one of the files exists - * }); - */ -var some = doParallel(_createTester(Boolean, identity)); + const startOffset = this._offset(start) + const endOffset = this._offset(end) + const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - */ -var someLimit = doParallelLimit(_createTester(Boolean, identity)); + if (endOffset[1] === 0) { + buffers.pop() + } else { + buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]) + } -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - */ -var someSeries = doLimit(someLimit, 1); + if (startOffset[1] !== 0) { + buffers[0] = buffers[0].slice(startOffset[1]) + } -/** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @example - * - * async.sortBy(['file1','file2','file3'], function(file, callback) { - * fs.stat(file, function(err, stats) { - * callback(err, stats.mtime); - * }); - * }, function(err, results) { - * // results is now the original array of files sorted by - * // modified date - * }); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy([1,9,3,5], function(x, callback) { - * callback(null, x); - * }, function(err,result) { - * // result callback - * }); - * - * // descending order - * async.sortBy([1,9,3,5], function(x, callback) { - * callback(null, x*-1); //<- x*-1 instead of x, turns the order around - * }, function(err,result) { - * // result callback - * }); - */ -function sortBy (coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - map(coll, function (x, callback) { - _iteratee(x, function (err, criteria) { - if (err) return callback(err); - callback(null, {value: x, criteria: criteria}); - }); - }, function (err, results) { - if (err) return callback(err); - callback(null, arrayMap(results.sort(comparator), baseProperty('value'))); - }); + return this._new(buffers) +} - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } +BufferList.prototype.toString = function toString (encoding, start, end) { + return this.slice(start, end).toString(encoding) } -/** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ -function timeout(asyncFn, milliseconds, info) { - var fn = wrapAsync(asyncFn); - - return initialParams(function (args, callback) { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } +BufferList.prototype.consume = function consume (bytes) { + // first, normalize the argument, in accordance with how Buffer does it + bytes = Math.trunc(bytes) + // do nothing if not a positive number + if (Number.isNaN(bytes) || bytes <= 0) return this - args.push(function () { - if (!timedOut) { - callback.apply(null, arguments); - clearTimeout(timer); - } - }); + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn.apply(null, args); - }); + return this } -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil; -var nativeMax = Math.max; - -/** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ -function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); +BufferList.prototype.duplicate = function duplicate () { + const copy = this._new() - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; + for (let i = 0; i < this._bufs.length; i++) { + copy.append(this._bufs[i]) } - return result; -} -/** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - */ -function timeLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - mapLimit(baseRange(0, count, 1), limit, _iteratee, callback); + return copy } -/** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ -var times = doLimit(timeLimit, Infinity); +BufferList.prototype.append = function append (buf) { + if (buf == null) { + return this + } -/** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - */ -var timesSeries = doLimit(timeLimit, 1); + if (buf.buffer) { + // append a view of the underlying ArrayBuffer + this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)) + } else if (Array.isArray(buf)) { + for (let i = 0; i < buf.length; i++) { + this.append(buf[i]) + } + } else if (this._isBufferList(buf)) { + // unwrap argument into individual BufferLists + for (let i = 0; i < buf._bufs.length; i++) { + this.append(buf._bufs[i]) + } + } else { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf === 'number') { + buf = buf.toString() + } -/** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in series, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @example - * - * async.transform([1,2,3], function(acc, item, index, callback) { - * // pointless async: - * process.nextTick(function() { - * acc.push(item * 2) - * callback(null) - * }); - * }, function(err, result) { - * // result is now equal to [2, 4, 6] - * }); - * - * @example - * - * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) { - * setImmediate(function () { - * obj[key] = val * 2; - * callback(); - * }) - * }, function (err, result) { - * // result is equal to {a: 2, b: 4, c: 6} - * }) - */ -function transform (coll, accumulator, iteratee, callback) { - if (arguments.length <= 3) { - callback = iteratee; - iteratee = accumulator; - accumulator = isArray(coll) ? [] : {}; - } - callback = once(callback || noop); - var _iteratee = wrapAsync(iteratee); - - eachOf(coll, function(v, k, cb) { - _iteratee(accumulator, v, k, cb); - }, function(err) { - callback(err, accumulator); - }); -} + this._appendBuffer(Buffer.from(buf)) + } -/** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ -function tryEach(tasks, callback) { - var error = null; - var result; - callback = callback || noop; - eachSeries(tasks, function(task, callback) { - wrapAsync(task)(function (err, res/*, ...args*/) { - if (arguments.length > 2) { - result = slice(arguments, 1); - } else { - result = res; - } - error = err; - callback(!err); - }); - }, function () { - callback(error, result); - }); + return this } -/** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ -function unmemoize(fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; +BufferList.prototype._appendBuffer = function appendBuffer (buf) { + this._bufs.push(buf) + this.length += buf.length } -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Function} test - synchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns undefined - * @example - * - * var count = 0; - * async.whilst( - * function() { return count < 5; }, - * function(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = onlyOnce(callback || noop); - var _iteratee = wrapAsync(iteratee); - if (!test()) return callback(null); - var next = function(err/*, ...args*/) { - if (err) return callback(err); - if (test()) return _iteratee(next); - var args = slice(arguments, 1); - callback.apply(null, [null].concat(args)); - }; - _iteratee(next); -} +BufferList.prototype.indexOf = function (search, offset, encoding) { + if (encoding === undefined && typeof offset === 'string') { + encoding = offset + offset = undefined + } -/** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {Function} test - synchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - */ -function until(test, iteratee, callback) { - whilst(function() { - return !test.apply(this, arguments); - }, iteratee, callback); -} + if (typeof search === 'function' || Array.isArray(search)) { + throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.') + } else if (typeof search === 'number') { + search = Buffer.from([search]) + } else if (typeof search === 'string') { + search = Buffer.from(search, encoding) + } else if (this._isBufferList(search)) { + search = search.slice() + } else if (Array.isArray(search.buffer)) { + search = Buffer.from(search.buffer, search.byteOffset, search.byteLength) + } else if (!Buffer.isBuffer(search)) { + search = Buffer.from(search) + } -/** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns undefined - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ -var waterfall = function(tasks, callback) { - callback = once(callback || noop); - if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; + offset = Number(offset || 0) - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - args.push(onlyOnce(next)); - task.apply(null, args); - } + if (isNaN(offset)) { + offset = 0 + } - function next(err/*, ...args*/) { - if (err || taskIndex === tasks.length) { - return callback.apply(null, arguments); - } - nextTask(slice(arguments, 1)); - } + if (offset < 0) { + offset = this.length + offset + } - nextTask([]); -}; + if (offset < 0) { + offset = 0 + } -/** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ + if (search.length === 0) { + return offset > this.length ? this.length : offset + } -/** - * Async is a utility module which provides straight-forward, powerful functions - * for working with asynchronous JavaScript. Although originally designed for - * use with [Node.js](http://nodejs.org) and installable via - * `npm install --save async`, it can also be used directly in the browser. - * @module async - * @see AsyncFunction - */ + const blOffset = this._offset(offset) + let blIndex = blOffset[0] // index of which internal buffer we're working on + let buffOffset = blOffset[1] // offset of the internal buffer we're working on + // scan over each buffer + for (; blIndex < this._bufs.length; blIndex++) { + const buff = this._bufs[blIndex] -/** - * A collection of `async` functions for manipulating collections, such as - * arrays and objects. - * @module Collections - */ + while (buffOffset < buff.length) { + const availableWindow = buff.length - buffOffset -/** - * A collection of `async` functions for controlling the flow through a script. - * @module ControlFlow - */ + if (availableWindow >= search.length) { + const nativeSearchResult = buff.indexOf(search, buffOffset) -/** - * A collection of `async` utility functions. - * @module Utils - */ + if (nativeSearchResult !== -1) { + return this._reverseOffset([blIndex, nativeSearchResult]) + } -var index = { - apply: apply, - applyEach: applyEach, - applyEachSeries: applyEachSeries, - asyncify: asyncify, - auto: auto, - autoInject: autoInject, - cargo: cargo, - compose: compose, - concat: concat, - concatLimit: concatLimit, - concatSeries: concatSeries, - constant: constant, - detect: detect, - detectLimit: detectLimit, - detectSeries: detectSeries, - dir: dir, - doDuring: doDuring, - doUntil: doUntil, - doWhilst: doWhilst, - during: during, - each: eachLimit, - eachLimit: eachLimit$1, - eachOf: eachOf, - eachOfLimit: eachOfLimit, - eachOfSeries: eachOfSeries, - eachSeries: eachSeries, - ensureAsync: ensureAsync, - every: every, - everyLimit: everyLimit, - everySeries: everySeries, - filter: filter, - filterLimit: filterLimit, - filterSeries: filterSeries, - forever: forever, - groupBy: groupBy, - groupByLimit: groupByLimit, - groupBySeries: groupBySeries, - log: log, - map: map, - mapLimit: mapLimit, - mapSeries: mapSeries, - mapValues: mapValues, - mapValuesLimit: mapValuesLimit, - mapValuesSeries: mapValuesSeries, - memoize: memoize, - nextTick: nextTick, - parallel: parallelLimit, - parallelLimit: parallelLimit$1, - priorityQueue: priorityQueue, - queue: queue$1, - race: race, - reduce: reduce, - reduceRight: reduceRight, - reflect: reflect, - reflectAll: reflectAll, - reject: reject, - rejectLimit: rejectLimit, - rejectSeries: rejectSeries, - retry: retry, - retryable: retryable, - seq: seq, - series: series, - setImmediate: setImmediate$1, - some: some, - someLimit: someLimit, - someSeries: someSeries, - sortBy: sortBy, - timeout: timeout, - times: times, - timesLimit: timeLimit, - timesSeries: timesSeries, - transform: transform, - tryEach: tryEach, - unmemoize: unmemoize, - until: until, - waterfall: waterfall, - whilst: whilst, - - // aliases - all: every, - allLimit: everyLimit, - allSeries: everySeries, - any: some, - anyLimit: someLimit, - anySeries: someSeries, - find: detect, - findLimit: detectLimit, - findSeries: detectSeries, - forEach: eachLimit, - forEachSeries: eachSeries, - forEachLimit: eachLimit$1, - forEachOf: eachOf, - forEachOfSeries: eachOfSeries, - forEachOfLimit: eachOfLimit, - inject: reduce, - foldl: reduce, - foldr: reduceRight, - select: filter, - selectLimit: filterLimit, - selectSeries: filterSeries, - wrapSync: asyncify -}; - -exports['default'] = index; -exports.apply = apply; -exports.applyEach = applyEach; -exports.applyEachSeries = applyEachSeries; -exports.asyncify = asyncify; -exports.auto = auto; -exports.autoInject = autoInject; -exports.cargo = cargo; -exports.compose = compose; -exports.concat = concat; -exports.concatLimit = concatLimit; -exports.concatSeries = concatSeries; -exports.constant = constant; -exports.detect = detect; -exports.detectLimit = detectLimit; -exports.detectSeries = detectSeries; -exports.dir = dir; -exports.doDuring = doDuring; -exports.doUntil = doUntil; -exports.doWhilst = doWhilst; -exports.during = during; -exports.each = eachLimit; -exports.eachLimit = eachLimit$1; -exports.eachOf = eachOf; -exports.eachOfLimit = eachOfLimit; -exports.eachOfSeries = eachOfSeries; -exports.eachSeries = eachSeries; -exports.ensureAsync = ensureAsync; -exports.every = every; -exports.everyLimit = everyLimit; -exports.everySeries = everySeries; -exports.filter = filter; -exports.filterLimit = filterLimit; -exports.filterSeries = filterSeries; -exports.forever = forever; -exports.groupBy = groupBy; -exports.groupByLimit = groupByLimit; -exports.groupBySeries = groupBySeries; -exports.log = log; -exports.map = map; -exports.mapLimit = mapLimit; -exports.mapSeries = mapSeries; -exports.mapValues = mapValues; -exports.mapValuesLimit = mapValuesLimit; -exports.mapValuesSeries = mapValuesSeries; -exports.memoize = memoize; -exports.nextTick = nextTick; -exports.parallel = parallelLimit; -exports.parallelLimit = parallelLimit$1; -exports.priorityQueue = priorityQueue; -exports.queue = queue$1; -exports.race = race; -exports.reduce = reduce; -exports.reduceRight = reduceRight; -exports.reflect = reflect; -exports.reflectAll = reflectAll; -exports.reject = reject; -exports.rejectLimit = rejectLimit; -exports.rejectSeries = rejectSeries; -exports.retry = retry; -exports.retryable = retryable; -exports.seq = seq; -exports.series = series; -exports.setImmediate = setImmediate$1; -exports.some = some; -exports.someLimit = someLimit; -exports.someSeries = someSeries; -exports.sortBy = sortBy; -exports.timeout = timeout; -exports.times = times; -exports.timesLimit = timeLimit; -exports.timesSeries = timesSeries; -exports.transform = transform; -exports.tryEach = tryEach; -exports.unmemoize = unmemoize; -exports.until = until; -exports.waterfall = waterfall; -exports.whilst = whilst; -exports.all = every; -exports.allLimit = everyLimit; -exports.allSeries = everySeries; -exports.any = some; -exports.anyLimit = someLimit; -exports.anySeries = someSeries; -exports.find = detect; -exports.findLimit = detectLimit; -exports.findSeries = detectSeries; -exports.forEach = eachLimit; -exports.forEachSeries = eachSeries; -exports.forEachLimit = eachLimit$1; -exports.forEachOf = eachOf; -exports.forEachOfSeries = eachOfSeries; -exports.forEachOfLimit = eachOfLimit; -exports.inject = reduce; -exports.foldl = reduce; -exports.foldr = reduceRight; -exports.select = filter; -exports.selectLimit = filterLimit; -exports.selectSeries = filterSeries; -exports.wrapSync = asyncify; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); + buffOffset = buff.length - search.length + 1 // end of native search window + } else { + const revOffset = this._reverseOffset([blIndex, buffOffset]) + if (this._match(revOffset, search)) { + return revOffset + } -/***/ }), + buffOffset++ + } + } -/***/ 898: -/***/ ((module) => { + buffOffset = 0 + } -module.exports = r => { - const n = process.versions.node.split('.').map(x => parseInt(x, 10)) - r = r.split('.').map(x => parseInt(x, 10)) - return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2]))) + return -1 +} + +BufferList.prototype._match = function (offset, search) { + if (this.length - offset < search.length) { + return false + } + + for (let searchOffset = 0; searchOffset < search.length; searchOffset++) { + if (this.get(offset + searchOffset) !== search[searchOffset]) { + return false + } + } + return true +} + +;(function () { + const methods = { + readDoubleBE: 8, + readDoubleLE: 8, + readFloatBE: 4, + readFloatLE: 4, + readInt32BE: 4, + readInt32LE: 4, + readUInt32BE: 4, + readUInt32LE: 4, + readInt16BE: 2, + readInt16LE: 2, + readUInt16BE: 2, + readUInt16LE: 2, + readInt8: 1, + readUInt8: 1, + readIntBE: null, + readIntLE: null, + readUIntBE: null, + readUIntLE: null + } + + for (const m in methods) { + (function (m) { + if (methods[m] === null) { + BufferList.prototype[m] = function (offset, byteLength) { + return this.slice(offset, offset + byteLength)[m](0, byteLength) + } + } else { + BufferList.prototype[m] = function (offset = 0) { + return this.slice(offset, offset + methods[m])[m](0) + } + } + }(m)) + } +}()) + +// Used internally by the class and also as an indicator of this object being +// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser +// environment because there could be multiple different copies of the +// BufferList class and some `BufferList`s might be `BufferList`s. +BufferList.prototype._isBufferList = function _isBufferList (b) { + return b instanceof BufferList || BufferList.isBufferList(b) } +BufferList.isBufferList = function isBufferList (b) { + return b != null && b[symbol] +} + +module.exports = BufferList + /***/ }), -/***/ 20587: -/***/ ((module) => { +/***/ 93453: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - var r = range(a, b, str); +const DuplexStream = __nccwpck_require__(68193).Duplex +const inherits = __nccwpck_require__(2989) +const BufferList = __nccwpck_require__(19628) - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; +function BufferListStream (callback) { + if (!(this instanceof BufferListStream)) { + return new BufferListStream(callback) + } + + if (typeof callback === 'function') { + this._callback = callback + + const piper = function piper (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) + + this.on('pipe', function onPipe (src) { + src.on('error', piper) + }) + this.on('unpipe', function onUnpipe (src) { + src.removeListener('error', piper) + }) + + callback = null + } + + BufferList._init.call(this, callback) + DuplexStream.call(this) } -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; +inherits(BufferListStream, DuplexStream) +Object.assign(BufferListStream.prototype, BufferList.prototype) + +BufferListStream.prototype._new = function _new (callback) { + return new BufferListStream(callback) } -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; +BufferListStream.prototype._write = function _write (buf, encoding, callback) { + this._appendBuffer(buf) - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; + if (typeof callback === 'function') { + callback() + } +} - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } +BufferListStream.prototype._read = function _read (size) { + if (!this.length) { + return this.push(null) + } - bi = str.indexOf(b, i + 1); - } + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) +} - i = ai < bi && ai >= 0 ? ai : bi; - } +BufferListStream.prototype.end = function end (chunk) { + DuplexStream.prototype.end.call(this, chunk) - if (begs.length) { - result = [ left, right ]; - } + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null } +} - return result; +BufferListStream.prototype._destroy = function _destroy (err, cb) { + this._bufs.length = 0 + this.length = 0 + cb(err) +} + +BufferListStream.prototype._isBufferList = function _isBufferList (b) { + return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b) } +BufferListStream.isBufferList = BufferList.isBufferList + +module.exports = BufferListStream +module.exports.BufferListStream = BufferListStream +module.exports.BufferList = BufferList + /***/ }), @@ -44674,6 +41230,7 @@ function range(a, b, str) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.boolean = void 0; const boolean = function (value) { if (typeof value === 'string') { return ['true', 't', 'yes', 'y', 'on', '1'].includes(value.trim().toLowerCase()); @@ -44691,18564 +41248,8321 @@ exports.boolean = boolean; /***/ }), -/***/ 85533: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 59832: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var concatMap = __webpack_require__(45179); -var balanced = __webpack_require__(20587); +var Buffer = __nccwpck_require__(64293).Buffer; -module.exports = expandTop; +var CRC_TABLE = [ + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d +]; -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; +if (typeof Int32Array !== 'undefined') { + CRC_TABLE = new Int32Array(CRC_TABLE); +} -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); +function ensureBuffer(input) { + if (Buffer.isBuffer(input)) { + return input; + } + + var hasNewBufferAPI = + typeof Buffer.alloc === "function" && + typeof Buffer.from === "function"; + + if (typeof input === "number") { + return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); + } + else if (typeof input === "string") { + return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); + } + else { + throw new Error("input must be buffer, number, or string, received " + + typeof input); + } } -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); +function bufferizeInt(num) { + var tmp = ensureBuffer(4); + tmp.writeInt32BE(num, 0); + return tmp; } -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); +function _crc32(buf, previous) { + buf = ensureBuffer(buf); + if (Buffer.isBuffer(previous)) { + previous = previous.readUInt32BE(0); + } + var crc = ~~previous ^ -1; + for (var n = 0; n < buf.length; n++) { + crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); + } + return (crc ^ -1); } +function crc32() { + return bufferizeInt(_crc32.apply(null, arguments)); +} +crc32.signed = function () { + return _crc32.apply(null, arguments); +}; +crc32.unsigned = function () { + return _crc32.apply(null, arguments) >>> 0; +}; -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; +module.exports = crc32; - var parts = []; - var m = balanced('{', '}', str); - if (!m) - return str.split(','); +/***/ }), - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); +/***/ 24018: +/***/ ((module) => { - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } +"use strict"; - parts.push.apply(parts, p); +module.exports = object => { + const result = {}; - return parts; -} + for (const [key, value] of Object.entries(object)) { + result[key.toLowerCase()] = value; + } -function expandTop(str) { - if (!str) - return []; + return result; +}; - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - return expand(escapeBraces(str), true).map(unescapeBraces); -} +/***/ }), -function identity(e) { - return e; -} +/***/ 78837: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} +"use strict"; -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} -function expand(str, isTop) { - var expansions = []; +const EventEmitter = __nccwpck_require__(28614); +const urlLib = __nccwpck_require__(78835); +const normalizeUrl = __nccwpck_require__(68938); +const getStream = __nccwpck_require__(63886); +const CachePolicy = __nccwpck_require__(19630); +const Response = __nccwpck_require__(39014); +const lowercaseKeys = __nccwpck_require__(24018); +const cloneResponse = __nccwpck_require__(2116); +const Keyv = __nccwpck_require__(88735); - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; +class CacheableRequest { + constructor(request, cacheAdapter) { + if (typeof request !== 'function') { + throw new TypeError('Parameter `request` must be a function'); + } - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } + this.cache = new Keyv({ + uri: typeof cacheAdapter === 'string' && cacheAdapter, + store: typeof cacheAdapter !== 'string' && cacheAdapter, + namespace: 'cacheable-request' + }); - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } + return this.createCacheableRequest(request); + } - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. + createCacheableRequest(request) { + return (opts, cb) => { + let url; + if (typeof opts === 'string') { + url = normalizeUrlObject(urlLib.parse(opts)); + opts = {}; + } else if (opts instanceof urlLib.URL) { + url = normalizeUrlObject(urlLib.parse(opts.toString())); + opts = {}; + } else { + const [pathname, ...searchParts] = (opts.path || '').split('?'); + const search = searchParts.length > 0 ? + `?${searchParts.join('?')}` : + ''; + url = normalizeUrlObject({ ...opts, pathname, search }); + } - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; + opts = { + headers: {}, + method: 'GET', + cache: true, + strictTtl: false, + automaticFailover: false, + ...opts, + ...urlObjectToRequestOptions(url) + }; + opts.headers = lowercaseKeys(opts.headers); - var N; + const ee = new EventEmitter(); + const normalizedUrlString = normalizeUrl( + urlLib.format(url), + { + stripWWW: false, + removeTrailingSlash: false, + stripAuthentication: false + } + ); + const key = `${opts.method}:${normalizedUrlString}`; + let revalidate = false; + let madeRequest = false; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); + const makeRequest = opts => { + madeRequest = true; + let requestErrored = false; + let requestErrorCallback; - N = []; + const requestErrorPromise = new Promise(resolve => { + requestErrorCallback = () => { + if (!requestErrored) { + requestErrored = true; + resolve(); + } + }; + }); - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } + const handler = response => { + if (revalidate && !opts.forceRefresh) { + response.status = response.statusCode; + const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); + if (!revalidatedPolicy.modified) { + const headers = revalidatedPolicy.policy.responseHeaders(); + response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); + response.cachePolicy = revalidatedPolicy.policy; + response.fromCache = true; + } + } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } + if (!response.fromCache) { + response.cachePolicy = new CachePolicy(opts, response, opts); + response.fromCache = false; + } - return expansions; -} + let clonedResponse; + if (opts.cache && response.cachePolicy.storable()) { + clonedResponse = cloneResponse(response); + (async () => { + try { + const bodyPromise = getStream.buffer(response); + await Promise.race([ + requestErrorPromise, + new Promise(resolve => response.once('end', resolve)) + ]); -/***/ }), + if (requestErrored) { + return; + } -/***/ 22706: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + const body = await bodyPromise; -"use strict"; + const value = { + cachePolicy: response.cachePolicy.toObject(), + url: response.url, + statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, + body + }; + let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; + if (opts.maxTtl) { + ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; + } -const stringify = __webpack_require__(82698); -const compile = __webpack_require__(13047); -const expand = __webpack_require__(2482); -const parse = __webpack_require__(25900); + await this.cache.set(key, value, ttl); + } catch (error) { + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + } else if (opts.cache && revalidate) { + (async () => { + try { + await this.cache.delete(key); + } catch (error) { + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + } -/** - * Expand the given pattern or create a regex-compatible string. - * - * ```js - * const braces = require('braces'); - * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] - * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ + ee.emit('response', clonedResponse || response); + if (typeof cb === 'function') { + cb(clonedResponse || response); + } + }; -const braces = (input, options = {}) => { - let output = []; + try { + const req = request(opts, handler); + req.once('error', requestErrorCallback); + req.once('abort', requestErrorCallback); + ee.emit('request', req); + } catch (error) { + ee.emit('error', new CacheableRequest.RequestError(error)); + } + }; - if (Array.isArray(input)) { - for (let pattern of input) { - let result = braces.create(pattern, options); - if (Array.isArray(result)) { - output.push(...result); - } else { - output.push(result); - } - } - } else { - output = [].concat(braces.create(input, options)); - } + (async () => { + const get = async opts => { + await Promise.resolve(); - if (options && options.expand === true && options.nodupes === true) { - output = [...new Set(output)]; - } - return output; -}; + const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; + if (typeof cacheEntry === 'undefined') { + return makeRequest(opts); + } -/** - * Parse the given `str` with the given `options`. - * - * ```js - * // braces.parse(pattern, [, options]); - * const ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * ``` - * @param {String} pattern Brace pattern to parse - * @param {Object} options - * @return {Object} Returns an AST - * @api public - */ + const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); + if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { + const headers = policy.responseHeaders(); + const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); + response.cachePolicy = policy; + response.fromCache = true; -braces.parse = (input, options = {}) => parse(input, options); + ee.emit('response', response); + if (typeof cb === 'function') { + cb(response); + } + } else { + revalidate = cacheEntry; + opts.headers = policy.revalidationHeaders(opts); + makeRequest(opts); + } + }; -/** - * Creates a braces string from an AST, or an AST node. - * - * ```js - * const braces = require('braces'); - * let ast = braces.parse('foo/{a,b}/bar'); - * console.log(stringify(ast.nodes[2])); //=> '{a,b}' - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); + this.cache.once('error', errorHandler); + ee.on('response', () => this.cache.removeListener('error', errorHandler)); -braces.stringify = (input, options = {}) => { - if (typeof input === 'string') { - return stringify(braces.parse(input, options), options); - } - return stringify(input, options); -}; + try { + await get(opts); + } catch (error) { + if (opts.automaticFailover && !madeRequest) { + makeRequest(opts); + } -/** - * Compiles a brace pattern into a regex-compatible, optimized string. - * This method is called by the main [braces](#braces) function by default. - * - * ```js - * const braces = require('braces'); - * console.log(braces.compile('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); -braces.compile = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - return compile(input, options); + return ee; + }; + } +} + +function urlObjectToRequestOptions(url) { + const options = { ...url }; + options.path = `${url.pathname || '/'}${url.search || ''}`; + delete options.pathname; + delete options.search; + return options; +} + +function normalizeUrlObject(url) { + // If url was parsed by url.parse or new URL: + // - hostname will be set + // - host will be hostname[:port] + // - port will be set if it was explicit in the parsed string + // Otherwise, url was from request options: + // - hostname or host may be set + // - host shall not have port encoded + return { + protocol: url.protocol, + auth: url.auth, + hostname: url.hostname || url.host || 'localhost', + port: url.port, + pathname: url.pathname, + search: url.search + }; +} + +CacheableRequest.RequestError = class extends Error { + constructor(error) { + super(error.message); + this.name = 'RequestError'; + Object.assign(this, error); + } }; -/** - * Expands a brace pattern into an array. This method is called by the - * main [braces](#braces) function when `options.expand` is true. Before - * using this method it's recommended that you read the [performance notes](#performance)) - * and advantages of using [.compile](#compile) instead. - * - * ```js - * const braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ +CacheableRequest.CacheError = class extends Error { + constructor(error) { + super(error.message); + this.name = 'CacheError'; + Object.assign(this, error); + } +}; -braces.expand = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } +module.exports = CacheableRequest; - let result = expand(input, options); - // filter out empty strings if specified - if (options.noempty === true) { - result = result.filter(Boolean); - } +/***/ }), - // filter out duplicates if specified - if (options.nodupes === true) { - result = [...new Set(result)]; - } +/***/ 7833: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return result; -}; +"use strict"; -/** - * Processes a brace pattern and returns either an expanded array - * (if `options.expand` is true), a highly optimized regex-compatible string. - * This method is called by the main [braces](#braces) function. - * - * ```js - * const braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ +const ansiStyles = __nccwpck_require__(58588); +const {stdout: stdoutColor, stderr: stderrColor} = __nccwpck_require__(28106); +const { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex +} = __nccwpck_require__(15254); -braces.create = (input, options = {}) => { - if (input === '' || input.length < 3) { - return [input]; - } +const {isArray} = Array; - return options.expand !== true - ? braces.compile(input, options) - : braces.expand(input, options); -}; +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = [ + 'ansi', + 'ansi', + 'ansi256', + 'ansi16m' +]; -/** - * Expose "braces" - */ +const styles = Object.create(null); -module.exports = braces; +const applyOptions = (object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error('The `level` option should be an integer from 0 to 3'); + } + // Detect level if not set manually + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === undefined ? colorLevel : options.level; +}; -/***/ }), +class ChalkClass { + constructor(options) { + // eslint-disable-next-line no-constructor-return + return chalkFactory(options); + } +} -/***/ 13047: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +const chalkFactory = options => { + const chalk = {}; + applyOptions(chalk, options); -"use strict"; + chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); -const fill = __webpack_require__(35955); -const utils = __webpack_require__(68130); + chalk.template.constructor = () => { + throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); + }; -const compile = (ast, options = {}) => { - let walk = (node, parent = {}) => { - let invalidBlock = utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let invalid = invalidBlock === true || invalidNode === true; - let prefix = options.escapeInvalid === true ? '\\' : ''; - let output = ''; + chalk.template.Instance = ChalkClass; - if (node.isOpen === true) { - return prefix + node.value; - } - if (node.isClose === true) { - return prefix + node.value; - } + return chalk.template; +}; - if (node.type === 'open') { - return invalid ? (prefix + node.value) : '('; - } +function Chalk(options) { + return chalkFactory(options); +} - if (node.type === 'close') { - return invalid ? (prefix + node.value) : ')'; - } +for (const [styleName, style] of Object.entries(ansiStyles)) { + styles[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); + Object.defineProperty(this, styleName, {value: builder}); + return builder; + } + }; +} - if (node.type === 'comma') { - return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); - } +styles.visible = { + get() { + const builder = createBuilder(this, this._styler, true); + Object.defineProperty(this, 'visible', {value: builder}); + return builder; + } +}; - if (node.value) { - return node.value; - } +const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); - let range = fill(...args, { ...options, wrap: false, toRegex: true }); +for (const model of usedModels) { + styles[model] = { + get() { + const {level} = this; + return function (...arguments_) { + const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; +} - if (range.length !== 0) { - return args.length > 1 && range.length > 1 ? `(${range})` : range; - } - } +for (const model of usedModels) { + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const {level} = this; + return function (...arguments_) { + const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; +} - if (node.nodes) { - for (let child of node.nodes) { - output += walk(child, node); - } - } - return output; - }; +const proto = Object.defineProperties(() => {}, { + ...styles, + level: { + enumerable: true, + get() { + return this._generator.level; + }, + set(level) { + this._generator.level = level; + } + } +}); - return walk(ast); +const createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === undefined) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } + + return { + open, + close, + openAll, + closeAll, + parent + }; }; -module.exports = compile; +const createBuilder = (self, _styler, _isEmpty) => { + const builder = (...arguments_) => { + if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { + // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` + return applyStyle(builder, chalkTag(builder, ...arguments_)); + } + // Single argument is hot path, implicit coercion is faster than anything + // eslint-disable-next-line no-implicit-coercion + return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); + }; -/***/ }), + // We alter the prototype because we must return a function, but there is + // no way to create a function with a different prototype + Object.setPrototypeOf(builder, proto); -/***/ 9552: -/***/ ((module) => { + builder._generator = self; + builder._styler = _styler; + builder._isEmpty = _isEmpty; -"use strict"; + return builder; +}; +const applyStyle = (self, string) => { + if (self.level <= 0 || !string) { + return self._isEmpty ? '' : string; + } -module.exports = { - MAX_LENGTH: 1024 * 64, + let styler = self._styler; - // Digits - CHAR_0: '0', /* 0 */ - CHAR_9: '9', /* 9 */ + if (styler === undefined) { + return string; + } - // Alphabet chars. - CHAR_UPPERCASE_A: 'A', /* A */ - CHAR_LOWERCASE_A: 'a', /* a */ - CHAR_UPPERCASE_Z: 'Z', /* Z */ - CHAR_LOWERCASE_Z: 'z', /* z */ + const {openAll, closeAll} = styler; + if (string.indexOf('\u001B') !== -1) { + while (styler !== undefined) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + string = stringReplaceAll(string, styler.close, styler.open); - CHAR_LEFT_PARENTHESES: '(', /* ( */ - CHAR_RIGHT_PARENTHESES: ')', /* ) */ + styler = styler.parent; + } + } - CHAR_ASTERISK: '*', /* * */ + // We can move both next actions out of loop, because remaining actions in loop won't have + // any/visible effect on parts we add here. Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 + const lfIndex = string.indexOf('\n'); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } - // Non-alphabetic chars. - CHAR_AMPERSAND: '&', /* & */ - CHAR_AT: '@', /* @ */ - CHAR_BACKSLASH: '\\', /* \ */ - CHAR_BACKTICK: '`', /* ` */ - CHAR_CARRIAGE_RETURN: '\r', /* \r */ - CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ - CHAR_COLON: ':', /* : */ - CHAR_COMMA: ',', /* , */ - CHAR_DOLLAR: '$', /* . */ - CHAR_DOT: '.', /* . */ - CHAR_DOUBLE_QUOTE: '"', /* " */ - CHAR_EQUAL: '=', /* = */ - CHAR_EXCLAMATION_MARK: '!', /* ! */ - CHAR_FORM_FEED: '\f', /* \f */ - CHAR_FORWARD_SLASH: '/', /* / */ - CHAR_HASH: '#', /* # */ - CHAR_HYPHEN_MINUS: '-', /* - */ - CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ - CHAR_LEFT_CURLY_BRACE: '{', /* { */ - CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ - CHAR_LINE_FEED: '\n', /* \n */ - CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ - CHAR_PERCENT: '%', /* % */ - CHAR_PLUS: '+', /* + */ - CHAR_QUESTION_MARK: '?', /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ - CHAR_RIGHT_CURLY_BRACE: '}', /* } */ - CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ - CHAR_SEMICOLON: ';', /* ; */ - CHAR_SINGLE_QUOTE: '\'', /* ' */ - CHAR_SPACE: ' ', /* */ - CHAR_TAB: '\t', /* \t */ - CHAR_UNDERSCORE: '_', /* _ */ - CHAR_VERTICAL_LINE: '|', /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ + return openAll + string + closeAll; }; +let template; +const chalkTag = (chalk, ...strings) => { + const [firstString] = strings; -/***/ }), + if (!isArray(firstString) || !isArray(firstString.raw)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return strings.join(' '); + } -/***/ 2482: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + const arguments_ = strings.slice(1); + const parts = [firstString.raw[0]]; -"use strict"; + for (let i = 1; i < firstString.length; i++) { + parts.push( + String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), + String(firstString.raw[i]) + ); + } + if (template === undefined) { + template = __nccwpck_require__(77183); + } -const fill = __webpack_require__(35955); -const stringify = __webpack_require__(82698); -const utils = __webpack_require__(68130); + return template(chalk, parts.join('')); +}; -const append = (queue = '', stash = '', enclose = false) => { - let result = []; +Object.defineProperties(Chalk.prototype, styles); - queue = [].concat(queue); - stash = [].concat(stash); +const chalk = Chalk(); // eslint-disable-line new-cap +chalk.supportsColor = stdoutColor; +chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap +chalk.stderr.supportsColor = stderrColor; - if (!stash.length) return queue; - if (!queue.length) { - return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; - } - - for (let item of queue) { - if (Array.isArray(item)) { - for (let value of item) { - result.push(append(value, stash, enclose)); - } - } else { - for (let ele of stash) { - if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; - result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); - } - } - } - return utils.flatten(result); -}; - -const expand = (ast, options = {}) => { - let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; +module.exports = chalk; - let walk = (node, parent = {}) => { - node.queue = []; - let p = parent; - let q = parent.queue; +/***/ }), - while (p.type !== 'brace' && p.type !== 'root' && p.parent) { - p = p.parent; - q = p.queue; - } +/***/ 77183: +/***/ ((module) => { - if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify(node, options))); - return; - } +"use strict"; - if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { - q.push(append(q.pop(), ['{}'])); - return; - } +const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; +const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; +const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; +const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); +const ESCAPES = new Map([ + ['n', '\n'], + ['r', '\r'], + ['t', '\t'], + ['b', '\b'], + ['f', '\f'], + ['v', '\v'], + ['0', '\0'], + ['\\', '\\'], + ['e', '\u001B'], + ['a', '\u0007'] +]); - if (utils.exceedsLimit(...args, options.step, rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } +function unescape(c) { + const u = c[0] === 'u'; + const bracket = c[1] === '{'; - let range = fill(...args, options); - if (range.length === 0) { - range = stringify(node, options); - } + if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { + return String.fromCharCode(parseInt(c.slice(1), 16)); + } - q.push(append(q.pop(), range)); - node.nodes = []; - return; - } + if (u && bracket) { + return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); + } - let enclose = utils.encloseBrace(node); - let queue = node.queue; - let block = node; + return ESCAPES.get(c) || c; +} - while (block.type !== 'brace' && block.type !== 'root' && block.parent) { - block = block.parent; - queue = block.queue; - } +function parseArguments(name, arguments_) { + const results = []; + const chunks = arguments_.trim().split(/\s*,\s*/g); + let matches; - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i]; + for (const chunk of chunks) { + const number = Number(chunk); + if (!Number.isNaN(number)) { + results.push(number); + } else if ((matches = chunk.match(STRING_REGEX))) { + results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); + } + } - if (child.type === 'comma' && node.type === 'brace') { - if (i === 1) queue.push(''); - queue.push(''); - continue; - } + return results; +} - if (child.type === 'close') { - q.push(append(q.pop(), queue, enclose)); - continue; - } +function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; - if (child.value && child.type !== 'open') { - queue.push(append(queue.pop(), child.value)); - continue; - } + const results = []; + let matches; - if (child.nodes) { - walk(child, node); - } - } + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; - return queue; - }; + if (matches[2]) { + const args = parseArguments(name, matches[2]); + results.push([name].concat(args)); + } else { + results.push([name]); + } + } - return utils.flatten(walk(ast)); -}; + return results; +} -module.exports = expand; +function buildStyle(chalk, styles) { + const enabled = {}; + for (const layer of styles) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } + } -/***/ }), + let current = chalk; + for (const [styleName, styles] of Object.entries(enabled)) { + if (!Array.isArray(styles)) { + continue; + } -/***/ 25900: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } -"use strict"; + current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; + } + return current; +} -const stringify = __webpack_require__(82698); +module.exports = (chalk, temporary) => { + const styles = []; + const chunks = []; + let chunk = []; -/** - * Constants - */ + // eslint-disable-next-line max-params + temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { + if (escapeCharacter) { + chunk.push(unescape(escapeCharacter)); + } else if (style) { + const string = chunk.join(''); + chunk = []; + chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); + styles.push({inverse, styles: parseStyle(style)}); + } else if (close) { + if (styles.length === 0) { + throw new Error('Found extraneous } in Chalk template literal'); + } -const { - MAX_LENGTH, - CHAR_BACKSLASH, /* \ */ - CHAR_BACKTICK, /* ` */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_RIGHT_SQUARE_BRACKET, /* ] */ - CHAR_DOUBLE_QUOTE, /* " */ - CHAR_SINGLE_QUOTE, /* ' */ - CHAR_NO_BREAK_SPACE, - CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = __webpack_require__(9552); + chunks.push(buildStyle(chalk, styles)(chunk.join(''))); + chunk = []; + styles.pop(); + } else { + chunk.push(character); + } + }); -/** - * parse - */ + chunks.push(chunk.join('')); -const parse = (input, options = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } + if (styles.length > 0) { + const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; + throw new Error(errMessage); + } - let opts = options || {}; - let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); - } + return chunks.join(''); +}; - let ast = { type: 'root', input, nodes: [] }; - let stack = [ast]; - let block = ast; - let prev = ast; - let brackets = 0; - let length = input.length; - let index = 0; - let depth = 0; - let value; - let memo = {}; - /** - * Helpers - */ +/***/ }), - const advance = () => input[index++]; - const push = node => { - if (node.type === 'text' && prev.type === 'dot') { - prev.type = 'text'; - } +/***/ 15254: +/***/ ((module) => { - if (prev && prev.type === 'text' && node.type === 'text') { - prev.value += node.value; - return; - } +"use strict"; - block.nodes.push(node); - node.parent = block; - node.prev = prev; - prev = node; - return node; - }; - push({ type: 'bos' }); +const stringReplaceAll = (string, substring, replacer) => { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } - while (index < length) { - block = stack[stack.length - 1]; - value = advance(); + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ''; + do { + returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); - /** - * Invalid chars - */ + returnValue += string.substr(endIndex); + return returnValue; +}; - if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { - continue; - } +const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { + let endIndex = 0; + let returnValue = ''; + do { + const gotCR = string[index - 1] === '\r'; + returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; + endIndex = index + 1; + index = string.indexOf('\n', endIndex); + } while (index !== -1); - /** - * Escaped chars - */ + returnValue += string.substr(endIndex); + return returnValue; +}; - if (value === CHAR_BACKSLASH) { - push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); - continue; - } +module.exports = { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex +}; - /** - * Right square bracket (literal): ']' - */ - if (value === CHAR_RIGHT_SQUARE_BRACKET) { - push({ type: 'text', value: '\\' + value }); - continue; - } +/***/ }), - /** - * Left square bracket: '[' - */ +/***/ 63488: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (value === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; +"use strict"; - let closed = true; - let next; - while (index < length && (next = advance())) { - value += next; +const spinners = Object.assign({}, __nccwpck_require__(20390)); - if (next === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - continue; - } +const spinnersList = Object.keys(spinners); - if (next === CHAR_BACKSLASH) { - value += advance(); - continue; - } +Object.defineProperty(spinners, 'random', { + get() { + const randomIndex = Math.floor(Math.random() * spinnersList.length); + const spinnerName = spinnersList[randomIndex]; + return spinners[spinnerName]; + } +}); - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - brackets--; +module.exports = spinners; +// TODO: Remove this for the next major release +module.exports.default = spinners; - if (brackets === 0) { - break; - } - } - } - push({ type: 'text', value }); - continue; - } +/***/ }), - /** - * Parentheses - */ +/***/ 2116: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (value === CHAR_LEFT_PARENTHESES) { - block = push({ type: 'paren', nodes: [] }); - stack.push(block); - push({ type: 'text', value }); - continue; - } +"use strict"; - if (value === CHAR_RIGHT_PARENTHESES) { - if (block.type !== 'paren') { - push({ type: 'text', value }); - continue; - } - block = stack.pop(); - push({ type: 'text', value }); - block = stack[stack.length - 1]; - continue; - } - /** - * Quotes: '|"|` - */ +const PassThrough = __nccwpck_require__(92413).PassThrough; +const mimicResponse = __nccwpck_require__(27480); - if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { - let open = value; - let next; +const cloneResponse = response => { + if (!(response && response.pipe)) { + throw new TypeError('Parameter `response` must be a response stream.'); + } - if (options.keepQuotes !== true) { - value = ''; - } + const clone = new PassThrough(); + mimicResponse(response, clone); - while (index < length && (next = advance())) { - if (next === CHAR_BACKSLASH) { - value += next + advance(); - continue; - } + return response.pipe(clone); +}; - if (next === open) { - if (options.keepQuotes === true) value += next; - break; - } +module.exports = cloneResponse; - value += next; - } - push({ type: 'text', value }); - continue; - } +/***/ }), - /** - * Left curly brace: '{' - */ +/***/ 13405: +/***/ ((module) => { - if (value === CHAR_LEFT_CURLY_BRACE) { - depth++; +var clone = (function() { +'use strict'; - let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; - let brace = { - type: 'brace', - open: true, - close: false, - dollar, - depth, - commas: 0, - ranges: 0, - nodes: [] - }; +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). +*/ +function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; - block = push(brace); - stack.push(block); - push({ type: 'open', value }); - continue; - } + var useBuffer = typeof Buffer != 'undefined'; - /** - * Right curly brace: '}' - */ + if (typeof circular == 'undefined') + circular = true; - if (value === CHAR_RIGHT_CURLY_BRACE) { - if (block.type !== 'brace') { - push({ type: 'text', value }); - continue; - } + if (typeof depth == 'undefined') + depth = Infinity; - let type = 'close'; - block = stack.pop(); - block.close = true; + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; - push({ type, value }); - depth--; + if (depth == 0) + return parent; - block = stack[stack.length - 1]; - continue; + var child; + var proto; + if (typeof parent != 'object') { + return parent; } - /** - * Comma: ',' - */ - - if (value === CHAR_COMMA && depth > 0) { - if (block.ranges > 0) { - block.ranges = 0; - let open = block.nodes.shift(); - block.nodes = [open, { type: 'text', value: stringify(block) }]; - } - - push({ type: 'comma', value }); - block.commas++; - continue; - } - - /** - * Dot: '.' - */ + if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + if (Buffer.allocUnsafe) { + // Node.js >= 4.5.0 + child = Buffer.allocUnsafe(parent.length); + } else { + // Older Node.js versions + child = new Buffer(parent.length); + } + parent.copy(child); + return child; + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } - if (value === CHAR_DOT && depth > 0 && block.commas === 0) { - let siblings = block.nodes; + if (circular) { + var index = allParents.indexOf(parent); - if (depth === 0 || siblings.length === 0) { - push({ type: 'text', value }); - continue; + if (index != -1) { + return allChildren[index]; } + allParents.push(parent); + allChildren.push(child); + } - if (prev.type === 'dot') { - block.range = []; - prev.value += value; - prev.type = 'range'; - - if (block.nodes.length !== 3 && block.nodes.length !== 5) { - block.invalid = true; - block.ranges = 0; - prev.type = 'text'; - continue; - } + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } - block.ranges++; - block.args = []; + if (attrs && attrs.set == null) { continue; } + child[i] = _clone(parent[i], depth - 1); + } - if (prev.type === 'range') { - siblings.pop(); + return child; + } - let before = siblings[siblings.length - 1]; - before.value += prev.value + value; - prev = before; - block.ranges--; - continue; - } + return _clone(parent, depth); +} - push({ type: 'dot', value }); - continue; - } +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; - /** - * Text - */ + var c = function () {}; + c.prototype = parent; + return new c(); +}; - push({ type: 'text', value }); - } +// private utility functions - // Mark imbalanced braces and brackets as invalid - do { - block = stack.pop(); +function __objToStr(o) { + return Object.prototype.toString.call(o); +}; +clone.__objToStr = __objToStr; - if (block.type !== 'root') { - block.nodes.forEach(node => { - if (!node.nodes) { - if (node.type === 'open') node.isOpen = true; - if (node.type === 'close') node.isClose = true; - if (!node.nodes) node.type = 'text'; - node.invalid = true; - } - }); +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +}; +clone.__isDate = __isDate; - // get the location of the block on parent.nodes (block's siblings) - let parent = stack[stack.length - 1]; - let index = parent.nodes.indexOf(block); - // replace the (invalid) block with it's nodes - parent.nodes.splice(index, 1, ...block.nodes); - } - } while (stack.length > 0); +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +}; +clone.__isArray = __isArray; - push({ type: 'eos' }); - return ast; +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; }; +clone.__isRegExp = __isRegExp; -module.exports = parse; +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +}; +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if ( true && module.exports) { + module.exports = clone; +} /***/ }), -/***/ 82698: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 92724: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/* MIT license */ +/* eslint-disable no-mixed-operators */ +const cssKeywords = __nccwpck_require__(78679); +// NOTE: conversions should only return primitive values (i.e. arrays, or +// values that give correct `typeof` results). +// do not use box values types (i.e. Number(), String(), etc.) -const utils = __webpack_require__(68130); +const reverseKeywords = {}; +for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; +} -module.exports = (ast, options = {}) => { - let stringify = (node, parent = {}) => { - let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let output = ''; +const convert = { + 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']} +}; - if (node.value) { - if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { - return '\\' + node.value; - } - return node.value; - } +module.exports = convert; - if (node.value) { - return node.value; - } +// Hide .channels and .labels properties +for (const model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } - if (node.nodes) { - for (let child of node.nodes) { - output += stringify(child); - } - } - return output; - }; + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } - return stringify(ast); -}; + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } + const {channels, labels} = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); +} +convert.rgb.hsl = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; -/***/ }), + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } -/***/ 68130: -/***/ ((__unused_webpack_module, exports) => { + h = Math.min(h * 60, 360); -"use strict"; + if (h < 0) { + h += 360; + } + const l = (min + max) / 2; -exports.isInteger = num => { - if (typeof num === 'number') { - return Number.isInteger(num); - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isInteger(Number(num)); - } - return false; + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } + + return [h, s * 100, l * 100]; }; -/** - * Find a node of the given type - */ +convert.rgb.hsv = function (rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s; -exports.find = (node, type) => node.nodes.find(node => node.type === type); + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; -/** - * Find a node of the given type - */ + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); -exports.exceedsLimit = (min, max, step = 1, limit) => { - if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) return false; - return ((Number(max) - Number(min)) / Number(step)) >= limit; + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; + } + + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + + return [ + h * 360, + s * 100, + v * 100 + ]; }; -/** - * Escape the given node with '\\' before node.value - */ +convert.rgb.hwb = function (rgb) { + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); -exports.escapeNode = (block, n = 0, type) => { - let node = block.nodes[n]; - if (!node) return; + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { - if (node.escaped !== true) { - node.value = '\\' + node.value; - node.escaped = true; - } - } + return [h, w * 100, b * 100]; }; -/** - * Returns true if the given brace node should be enclosed in literal braces - */ +convert.rgb.cmyk = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; -exports.encloseBrace = node => { - if (node.type !== 'brace') return false; - if ((node.commas >> 0 + node.ranges >> 0) === 0) { - node.invalid = true; - return true; - } - return false; + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; + + return [c * 100, m * 100, y * 100, k * 100]; }; -/** - * Returns true if a brace node is invalid. - */ +function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ + return ( + ((x[0] - y[0]) ** 2) + + ((x[1] - y[1]) ** 2) + + ((x[2] - y[2]) ** 2) + ); +} -exports.isInvalidBrace = block => { - if (block.type !== 'brace') return false; - if (block.invalid === true || block.dollar) return true; - if ((block.commas >> 0 + block.ranges >> 0) === 0) { - block.invalid = true; - return true; - } - if (block.open !== true || block.close !== true) { - block.invalid = true; - return true; - } - return false; +convert.rgb.keyword = function (rgb) { + const reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + + let currentClosestDistance = Infinity; + let currentClosestKeyword; + + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; + + // Compute comparative distance + const distance = comparativeDistance(rgb, value); + + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + + return currentClosestKeyword; }; -/** - * Returns true if a node is an open or close node - */ +convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; +}; -exports.isOpenOrClose = node => { - if (node.type === 'open' || node.type === 'close') { - return true; - } - return node.open === true || node.close === true; +convert.rgb.xyz = function (rgb) { + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; + + // Assume sRGB + r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); + g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); + b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); + + const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + + return [x * 100, y * 100, z * 100]; }; -/** - * Reduce an array of text nodes. - */ +convert.rgb.lab = function (rgb) { + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; -exports.reduce = nodes => nodes.reduce((acc, node) => { - if (node.type === 'text') acc.push(node.value); - if (node.type === 'range') node.type = 'text'; - return acc; -}, []); + x /= 95.047; + y /= 100; + z /= 108.883; -/** - * Flatten an array - */ + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); -exports.flatten = (...args) => { - const result = []; - const flat = arr => { - for (let i = 0; i < arr.length; i++) { - let ele = arr[i]; - Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele); - } - return result; - }; - flat(args); - return result; + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + + return [l, a, b]; }; +convert.hsl.rgb = function (hsl) { + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; -/***/ }), + if (s === 0) { + val = l * 255; + return [val, val, val]; + } -/***/ 59832: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } -var Buffer = __webpack_require__(64293).Buffer; + const t1 = 2 * l - t2; -var CRC_TABLE = [ - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, - 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, - 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, - 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, - 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, - 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, - 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, - 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, - 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, - 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, - 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, - 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, - 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, - 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, - 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, - 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, - 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, - 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, - 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, - 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, - 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, - 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, - 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, - 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, - 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, - 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, - 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, - 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, - 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, - 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, - 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, - 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, - 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, - 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, - 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, - 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, - 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, - 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, - 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, - 0x2d02ef8d -]; - -if (typeof Int32Array !== 'undefined') { - CRC_TABLE = new Int32Array(CRC_TABLE); -} - -function ensureBuffer(input) { - if (Buffer.isBuffer(input)) { - return input; - } - - var hasNewBufferAPI = - typeof Buffer.alloc === "function" && - typeof Buffer.from === "function"; + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } - if (typeof input === "number") { - return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); - } - else if (typeof input === "string") { - return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); - } - else { - throw new Error("input must be buffer, number, or string, received " + - typeof input); - } -} + if (t3 > 1) { + t3--; + } -function bufferizeInt(num) { - var tmp = ensureBuffer(4); - tmp.writeInt32BE(num, 0); - return tmp; -} + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } -function _crc32(buf, previous) { - buf = ensureBuffer(buf); - if (Buffer.isBuffer(previous)) { - previous = previous.readUInt32BE(0); - } - var crc = ~~previous ^ -1; - for (var n = 0; n < buf.length; n++) { - crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); - } - return (crc ^ -1); -} + rgb[i] = val * 255; + } -function crc32() { - return bufferizeInt(_crc32.apply(null, arguments)); -} -crc32.signed = function () { - return _crc32.apply(null, arguments); -}; -crc32.unsigned = function () { - return _crc32.apply(null, arguments) >>> 0; + return rgb; }; -module.exports = crc32; - +convert.hsl.hsv = function (hsl) { + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); -/***/ }), + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); -/***/ 24018: -/***/ ((module) => { + return [h, sv * 100, v * 100]; +}; -"use strict"; +convert.hsv.rgb = function (hsv) { + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; -module.exports = object => { - const result = {}; + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - (s * f)); + const t = 255 * v * (1 - (s * (1 - f))); + v *= 255; - for (const [key, value] of Object.entries(object)) { - result[key.toLowerCase()] = value; + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; } - - return result; }; +convert.hsv.hsl = function (hsv) { + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; -/***/ }), + l = (2 - s) * v; + const lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; -/***/ 78837: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return [h, sl * 100, l * 100]; +}; -"use strict"; +// http://dev.w3.org/csswg/css-color/#hwb-to-rgb +convert.hwb.rgb = function (hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; + // Wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } -const EventEmitter = __webpack_require__(28614); -const urlLib = __webpack_require__(78835); -const normalizeUrl = __webpack_require__(68938); -const getStream = __webpack_require__(63886); -const CachePolicy = __webpack_require__(19630); -const Response = __webpack_require__(39014); -const lowercaseKeys = __webpack_require__(24018); -const cloneResponse = __webpack_require__(2116); -const Keyv = __webpack_require__(88735); + const i = Math.floor(6 * h); + const v = 1 - bl; + f = 6 * h - i; -class CacheableRequest { - constructor(request, cacheAdapter) { - if (typeof request !== 'function') { - throw new TypeError('Parameter `request` must be a function'); - } + if ((i & 0x01) !== 0) { + f = 1 - f; + } - this.cache = new Keyv({ - uri: typeof cacheAdapter === 'string' && cacheAdapter, - store: typeof cacheAdapter !== 'string' && cacheAdapter, - namespace: 'cacheable-request' - }); + const n = wh + f * (v - wh); // Linear interpolation - return this.createCacheableRequest(request); + let r; + let g; + let b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; } + /* eslint-enable max-statements-per-line,no-multi-spaces */ - createCacheableRequest(request) { - return (opts, cb) => { - let url; - if (typeof opts === 'string') { - url = normalizeUrlObject(urlLib.parse(opts)); - opts = {}; - } else if (opts instanceof urlLib.URL) { - url = normalizeUrlObject(urlLib.parse(opts.toString())); - opts = {}; - } else { - const [pathname, ...searchParts] = (opts.path || '').split('?'); - const search = searchParts.length > 0 ? - `?${searchParts.join('?')}` : - ''; - url = normalizeUrlObject({ ...opts, pathname, search }); - } - - opts = { - headers: {}, - method: 'GET', - cache: true, - strictTtl: false, - automaticFailover: false, - ...opts, - ...urlObjectToRequestOptions(url) - }; - opts.headers = lowercaseKeys(opts.headers); + return [r * 255, g * 255, b * 255]; +}; - const ee = new EventEmitter(); - const normalizedUrlString = normalizeUrl( - urlLib.format(url), - { - stripWWW: false, - removeTrailingSlash: false, - stripAuthentication: false - } - ); - const key = `${opts.method}:${normalizedUrlString}`; - let revalidate = false; - let madeRequest = false; +convert.cmyk.rgb = function (cmyk) { + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; - const makeRequest = opts => { - madeRequest = true; - let requestErrored = false; - let requestErrorCallback; + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); - const requestErrorPromise = new Promise(resolve => { - requestErrorCallback = () => { - if (!requestErrored) { - requestErrored = true; - resolve(); - } - }; - }); + return [r * 255, g * 255, b * 255]; +}; - const handler = response => { - if (revalidate && !opts.forceRefresh) { - response.status = response.statusCode; - const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); - if (!revalidatedPolicy.modified) { - const headers = revalidatedPolicy.policy.responseHeaders(); - response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); - response.cachePolicy = revalidatedPolicy.policy; - response.fromCache = true; - } - } +convert.xyz.rgb = function (xyz) { + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; - if (!response.fromCache) { - response.cachePolicy = new CachePolicy(opts, response, opts); - response.fromCache = false; - } + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - let clonedResponse; - if (opts.cache && response.cachePolicy.storable()) { - clonedResponse = cloneResponse(response); + // Assume sRGB + r = r > 0.0031308 + ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) + : r * 12.92; - (async () => { - try { - const bodyPromise = getStream.buffer(response); + g = g > 0.0031308 + ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) + : g * 12.92; - await Promise.race([ - requestErrorPromise, - new Promise(resolve => response.once('end', resolve)) - ]); + b = b > 0.0031308 + ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) + : b * 12.92; - if (requestErrored) { - return; - } + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); - const body = await bodyPromise; + return [r * 255, g * 255, b * 255]; +}; - const value = { - cachePolicy: response.cachePolicy.toObject(), - url: response.url, - statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, - body - }; +convert.xyz.lab = function (xyz) { + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; - let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; - if (opts.maxTtl) { - ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; - } + x /= 95.047; + y /= 100; + z /= 108.883; - await this.cache.set(key, value, ttl); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } else if (opts.cache && revalidate) { - (async () => { - try { - await this.cache.delete(key); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - ee.emit('response', clonedResponse || response); - if (typeof cb === 'function') { - cb(clonedResponse || response); - } - }; + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); - try { - const req = request(opts, handler); - req.once('error', requestErrorCallback); - req.once('abort', requestErrorCallback); - ee.emit('request', req); - } catch (error) { - ee.emit('error', new CacheableRequest.RequestError(error)); - } - }; + return [l, a, b]; +}; - (async () => { - const get = async opts => { - await Promise.resolve(); +convert.lab.xyz = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; - const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; - if (typeof cacheEntry === 'undefined') { - return makeRequest(opts); - } + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; - const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); - if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { - const headers = policy.responseHeaders(); - const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); - response.cachePolicy = policy; - response.fromCache = true; + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - ee.emit('response', response); - if (typeof cb === 'function') { - cb(response); - } - } else { - revalidate = cacheEntry; - opts.headers = policy.revalidationHeaders(opts); - makeRequest(opts); - } - }; + x *= 95.047; + y *= 100; + z *= 108.883; - const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); - this.cache.once('error', errorHandler); - ee.on('response', () => this.cache.removeListener('error', errorHandler)); + return [x, y, z]; +}; - try { - await get(opts); - } catch (error) { - if (opts.automaticFailover && !madeRequest) { - makeRequest(opts); - } +convert.lab.lch = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); + const hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; - return ee; - }; + if (h < 0) { + h += 360; } -} - -function urlObjectToRequestOptions(url) { - const options = { ...url }; - options.path = `${url.pathname || '/'}${url.search || ''}`; - delete options.pathname; - delete options.search; - return options; -} - -function normalizeUrlObject(url) { - // If url was parsed by url.parse or new URL: - // - hostname will be set - // - host will be hostname[:port] - // - port will be set if it was explicit in the parsed string - // Otherwise, url was from request options: - // - hostname or host may be set - // - host shall not have port encoded - return { - protocol: url.protocol, - auth: url.auth, - hostname: url.hostname || url.host || 'localhost', - port: url.port, - pathname: url.pathname, - search: url.search - }; -} -CacheableRequest.RequestError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'RequestError'; - Object.assign(this, error); - } -}; + const c = Math.sqrt(a * a + b * b); -CacheableRequest.CacheError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'CacheError'; - Object.assign(this, error); - } + return [l, c, h]; }; -module.exports = CacheableRequest; - +convert.lch.lab = function (lch) { + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; -/***/ }), + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); -/***/ 7833: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return [l, a, b]; +}; -"use strict"; +convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization -const ansiStyles = __webpack_require__(58588); -const {stdout: stdoutColor, stderr: stderrColor} = __webpack_require__(28106); -const { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -} = __webpack_require__(15254); + value = Math.round(value / 50); -const {isArray} = Array; + if (value === 0) { + return 30; + } -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = [ - 'ansi', - 'ansi', - 'ansi256', - 'ansi16m' -]; - -const styles = Object.create(null); + let ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); -const applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error('The `level` option should be an integer from 0 to 3'); + if (value === 2) { + ansi += 60; } - // Detect level if not set manually - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === undefined ? colorLevel : options.level; + return ansi; }; -class ChalkClass { - constructor(options) { - // eslint-disable-next-line no-constructor-return - return chalkFactory(options); - } -} - -const chalkFactory = options => { - const chalk = {}; - applyOptions(chalk, options); - - chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - - chalk.template.constructor = () => { - throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); - }; - - chalk.template.Instance = ChalkClass; - - return chalk.template; +convert.hsv.ansi16 = function (args) { + // Optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; -function Chalk(options) { - return chalkFactory(options); -} +convert.rgb.ansi256 = function (args) { + const r = args[0]; + const g = args[1]; + const b = args[2]; -for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, {value: builder}); - return builder; + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; } - }; -} -styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, 'visible', {value: builder}); - return builder; + if (r > 248) { + return 231; + } + + return Math.round(((r - 8) / 247) * 24) + 232; } + + const ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); + + return ansi; }; -const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; +convert.ansi16.rgb = function (args) { + let color = args % 10; -for (const model of usedModels) { - styles[model] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; + // Handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; } - }; -} -for (const model of usedModels) { - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} + color = color / 10.5 * 255; -const proto = Object.defineProperties(() => {}, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; - } + return [color, color, color]; } -}); -const createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === undefined) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } + const mult = (~~(args > 50) + 1) * 0.5; + const r = ((color & 1) * mult) * 255; + const g = (((color >> 1) & 1) * mult) * 255; + const b = (((color >> 2) & 1) * mult) * 255; - return { - open, - close, - openAll, - closeAll, - parent - }; + return [r, g, b]; }; -const createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { - // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` - return applyStyle(builder, chalkTag(builder, ...arguments_)); - } - - // Single argument is hot path, implicit coercion is faster than anything - // eslint-disable-next-line no-implicit-coercion - return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); - }; +convert.ansi256.rgb = function (args) { + // Handle greyscale + if (args >= 232) { + const c = (args - 232) * 10 + 8; + return [c, c, c]; + } - // We alter the prototype because we must return a function, but there is - // no way to create a function with a different prototype - Object.setPrototypeOf(builder, proto); + args -= 16; - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = (rem % 6) / 5 * 255; - return builder; + return [r, g, b]; }; -const applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? '' : string; - } +convert.rgb.hex = function (args) { + const integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); - let styler = self._styler; + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; - if (styler === undefined) { - return string; +convert.hex.rgb = function (args) { + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; } - const {openAll, closeAll} = styler; - if (string.indexOf('\u001B') !== -1) { - while (styler !== undefined) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - string = stringReplaceAll(string, styler.close, styler.open); + let colorString = match[0]; - styler = styler.parent; - } + if (match[0].length === 3) { + colorString = colorString.split('').map(char => { + return char + char; + }).join(''); } - // We can move both next actions out of loop, because remaining actions in loop won't have - // any/visible effect on parts we add here. Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 - const lfIndex = string.indexOf('\n'); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 0xFF; + const g = (integer >> 8) & 0xFF; + const b = integer & 0xFF; - return openAll + string + closeAll; + return [r, g, b]; }; -let template; -const chalkTag = (chalk, ...strings) => { - const [firstString] = strings; +convert.rgb.hcg = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + const chroma = (max - min); + let grayscale; + let hue; - if (!isArray(firstString) || !isArray(firstString.raw)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return strings.join(' '); + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; } - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; - - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), - String(firstString.raw[i]) - ); + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; } - if (template === undefined) { - template = __webpack_require__(77183); - } + hue /= 6; + hue %= 1; - return template(chalk, parts.join('')); + return [hue * 360, chroma * 100, grayscale * 100]; }; -Object.defineProperties(Chalk.prototype, styles); - -const chalk = Chalk(); // eslint-disable-line new-cap -chalk.supportsColor = stdoutColor; -chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap -chalk.stderr.supportsColor = stderrColor; - -module.exports = chalk; +convert.hsl.hcg = function (hsl) { + const s = hsl[1] / 100; + const l = hsl[2] / 100; + const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); -/***/ }), + let f = 0; + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } -/***/ 77183: -/***/ ((module) => { + return [hsl[0], c * 100, f * 100]; +}; -"use strict"; +convert.hsv.hcg = function (hsv) { + const s = hsv[1] / 100; + const v = hsv[2] / 100; -const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; + const c = s * v; + let f = 0; -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); + if (c < 1.0) { + f = (v - c) / (1 - c); + } -function unescape(c) { - const u = c[0] === 'u'; - const bracket = c[1] === '{'; + return [hsv[0], c * 100, f * 100]; +}; - if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } +convert.hcg.rgb = function (hcg) { + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; } - return ESCAPES.get(c) || c; -} - -function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } + /* eslint-disable max-statements-per-line */ + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; } + /* eslint-enable max-statements-per-line */ - return results; -} + mg = (1.0 - c) * g; -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; +}; - const results = []; - let matches; +convert.hcg.hsv = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; + const v = c + g * (1.0 - c); + let f = 0; - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } + if (v > 0.0) { + f = c / v; } - return results; -} + return [hcg[0], f * 100, v * 100]; +}; -function buildStyle(chalk, styles) { - const enabled = {}; +convert.hcg.hsl = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } + const l = g * (1.0 - c) + 0.5 * c; + let s = 0; + + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); } - let current = chalk; - for (const [styleName, styles] of Object.entries(enabled)) { - if (!Array.isArray(styles)) { - continue; - } + return [hcg[0], s * 100, l * 100]; +}; - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } +convert.hcg.hwb = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; +}; - current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; +convert.hwb.hcg = function (hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; + + if (c < 1) { + g = (v - c) / (1 - c); } - return current; -} + return [hwb[0], c * 100, g * 100]; +}; -module.exports = (chalk, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; +convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; +}; - // eslint-disable-next-line max-params - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape(escapeCharacter)); - } else if (style) { - const string = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } +convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; +}; - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); +convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +}; - chunks.push(chunk.join('')); +convert.gray.hsl = function (args) { + return [0, 0, args[0]]; +}; - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMessage); - } +convert.gray.hsv = convert.gray.hsl; - return chunks.join(''); +convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; }; +convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; +}; -/***/ }), +convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; +}; -/***/ 15254: -/***/ ((module) => { +convert.gray.hex = function (gray) { + const val = Math.round(gray[0] / 100 * 255) & 0xFF; + const integer = (val << 16) + (val << 8) + val; -"use strict"; + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; - -const stringReplaceAll = (string, substring, replacer) => { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ''; - do { - returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - - returnValue += string.substr(endIndex); - return returnValue; -}; - -const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ''; - do { - const gotCR = string[index - 1] === '\r'; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; - endIndex = index + 1; - index = string.indexOf('\n', endIndex); - } while (index !== -1); - - returnValue += string.substr(endIndex); - return returnValue; -}; - -module.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -}; +convert.rgb.gray = function (rgb) { + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; +}; /***/ }), -/***/ 63488: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const spinners = Object.assign({}, __webpack_require__(20390)); - -const spinnersList = Object.keys(spinners); - -Object.defineProperty(spinners, 'random', { - get() { - const randomIndex = Math.floor(Math.random() * spinnersList.length); - const spinnerName = spinnersList[randomIndex]; - return spinners[spinnerName]; - } -}); - -module.exports = spinners; -// TODO: Remove this for the next major release -module.exports.default = spinners; +/***/ 73991: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const conversions = __nccwpck_require__(92724); +const route = __nccwpck_require__(40577); -/***/ }), +const convert = {}; -/***/ 2116: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +const models = Object.keys(conversions); -"use strict"; +function wrapRaw(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } + if (arg0.length > 1) { + args = arg0; + } -const PassThrough = __webpack_require__(92413).PassThrough; -const mimicResponse = __webpack_require__(27480); + return fn(args); + }; -const cloneResponse = response => { - if (!(response && response.pipe)) { - throw new TypeError('Parameter `response` must be a response stream.'); + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; } - const clone = new PassThrough(); - mimicResponse(response, clone); - - return response.pipe(clone); -}; - -module.exports = cloneResponse; - - -/***/ }), - -/***/ 13405: -/***/ ((module) => { - -var clone = (function() { -'use strict'; - -/** - * Clones (copies) an Object using deep copying. - * - * This function supports circular references by default, but if you are certain - * there are no circular references in your object, you can save some CPU time - * by calling clone(obj, false). - * - * Caution: if `circular` is false and `parent` contains circular references, - * your program may enter an infinite loop and crash. - * - * @param `parent` - the object to be cloned - * @param `circular` - set to true if the object to be cloned may contain - * circular references. (optional - true by default) - * @param `depth` - set to a number if the object is only to be cloned to - * a particular depth. (optional - defaults to Infinity) - * @param `prototype` - sets the prototype to be used when cloning an object. - * (optional - defaults to parent prototype). -*/ -function clone(parent, circular, depth, prototype) { - var filter; - if (typeof circular === 'object') { - depth = circular.depth; - prototype = circular.prototype; - filter = circular.filter; - circular = circular.circular - } - // maintain two arrays for circular references, where corresponding parents - // and children have the same index - var allParents = []; - var allChildren = []; - - var useBuffer = typeof Buffer != 'undefined'; - - if (typeof circular == 'undefined') - circular = true; - - if (typeof depth == 'undefined') - depth = Infinity; - - // recurse this function so we don't reset allParents and allChildren - function _clone(parent, depth) { - // cloning null always returns null - if (parent === null) - return null; - - if (depth == 0) - return parent; + return wrappedFn; +} - var child; - var proto; - if (typeof parent != 'object') { - return parent; - } +function wrapRounded(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; - if (clone.__isArray(parent)) { - child = []; - } else if (clone.__isRegExp(parent)) { - child = new RegExp(parent.source, __getRegExpFlags(parent)); - if (parent.lastIndex) child.lastIndex = parent.lastIndex; - } else if (clone.__isDate(parent)) { - child = new Date(parent.getTime()); - } else if (useBuffer && Buffer.isBuffer(parent)) { - if (Buffer.allocUnsafe) { - // Node.js >= 4.5.0 - child = Buffer.allocUnsafe(parent.length); - } else { - // Older Node.js versions - child = new Buffer(parent.length); - } - parent.copy(child); - return child; - } else { - if (typeof prototype == 'undefined') { - proto = Object.getPrototypeOf(parent); - child = Object.create(proto); - } - else { - child = Object.create(prototype); - proto = prototype; - } - } + if (arg0 === undefined || arg0 === null) { + return arg0; + } - if (circular) { - var index = allParents.indexOf(parent); + if (arg0.length > 1) { + args = arg0; + } - if (index != -1) { - return allChildren[index]; - } - allParents.push(parent); - allChildren.push(child); - } + const result = fn(args); - for (var i in parent) { - var attrs; - if (proto) { - attrs = Object.getOwnPropertyDescriptor(proto, i); - } + // We're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (let len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } - if (attrs && attrs.set == null) { - continue; - } - child[i] = _clone(parent[i], depth - 1); - } + return result; + }; - return child; - } + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } - return _clone(parent, depth); + return wrappedFn; } -/** - * Simple flat clone using prototype, accepts only objects, usefull for property - * override on FLAT configuration object (no nested props). - * - * USE WITH CAUTION! This may not behave as you wish if you do not know how this - * works. - */ -clone.clonePrototype = function clonePrototype(parent) { - if (parent === null) - return null; +models.forEach(fromModel => { + convert[fromModel] = {}; - var c = function () {}; - c.prototype = parent; - return new c(); -}; + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); -// private utility functions + const routes = route(fromModel); + const routeModels = Object.keys(routes); -function __objToStr(o) { - return Object.prototype.toString.call(o); -}; -clone.__objToStr = __objToStr; + routeModels.forEach(toModel => { + const fn = routes[toModel]; -function __isDate(o) { - return typeof o === 'object' && __objToStr(o) === '[object Date]'; -}; -clone.__isDate = __isDate; + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); -function __isArray(o) { - return typeof o === 'object' && __objToStr(o) === '[object Array]'; -}; -clone.__isArray = __isArray; +module.exports = convert; -function __isRegExp(o) { - return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; -}; -clone.__isRegExp = __isRegExp; -function __getRegExpFlags(re) { - var flags = ''; - if (re.global) flags += 'g'; - if (re.ignoreCase) flags += 'i'; - if (re.multiline) flags += 'm'; - return flags; -}; -clone.__getRegExpFlags = __getRegExpFlags; +/***/ }), -return clone; -})(); +/***/ 40577: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -if ( true && module.exports) { - module.exports = clone; -} +const conversions = __nccwpck_require__(92724); +/* + This function routes a model to all other models. -/***/ }), + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). -/***/ 92724: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + conversions that are not possible simply are not included. +*/ -/* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = __webpack_require__(78679); +function buildGraph() { + const graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + const models = Object.keys(conversions); -// NOTE: conversions should only return primitive values (i.e. arrays, or -// values that give correct `typeof` results). -// do not use box values types (i.e. Number(), String(), etc.) + for (let len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; + return graph; } -const convert = { - 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']} -}; +// https://en.wikipedia.org/wiki/Breadth-first_search +function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; // Unshift -> queue -> pop -module.exports = convert; + graph[fromModel].distance = 0; -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } } - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); + return graph; } -convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - - h = Math.min(h * 60, 360); - - if (h < 0) { - h += 360; - } +function link(from, to) { + return function (args) { + return to(from(args)); + }; +} - const l = (min + max) / 2; +function wrapConversion(toModel, graph) { + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; } - return [h, s * 100, l * 100]; -}; - -convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; + fn.conversion = path; + return fn; +} - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { - return (v - c) / 6 / diff + 1 / 2; - }; +module.exports = function (fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = (1 / 3) + rdif - bdif; - } else if (b === v) { - h = (2 / 3) + gdif - rdif; + if (node.parent === null) { + // No possible conversion, or this node is the source model. + continue; } - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } + conversion[toModel] = wrapConversion(toModel, graph); } - return [ - h * 360, - s * 100, - v * 100 - ]; -}; - -convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - - return [h, w * 100, b * 100]; + return conversion; }; -convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; - return [c * 100, m * 100, y * 100, k * 100]; -}; -function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ - return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) - ); -} +/***/ }), -convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } +/***/ 78679: +/***/ ((module) => { - let currentClosestDistance = Infinity; - let currentClosestKeyword; +"use strict"; - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - // Compute comparative distance - const distance = comparativeDistance(rgb, value); - - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } - - return currentClosestKeyword; +module.exports = { + "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] }; -convert.keyword.rgb = function (keyword) { - return cssKeywords[keyword]; -}; -convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; +/***/ }), - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); +/***/ 18271: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); +var ProtoList = __nccwpck_require__(98051) + , path = __nccwpck_require__(85622) + , fs = __nccwpck_require__(35747) + , ini = __nccwpck_require__(27452) + , EE = __nccwpck_require__(28614).EventEmitter + , url = __nccwpck_require__(78835) + , http = __nccwpck_require__(98605) - return [x * 100, y * 100, z * 100]; -}; +var exports = module.exports = function () { + var args = [].slice.call(arguments) + , conf = new ConfigChain() -convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; + while(args.length) { + var a = args.shift() + if(a) conf.push + ( 'string' === typeof a + ? json(a) + : a ) + } - x /= 95.047; - y /= 100; - z /= 108.883; + return conf +} - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); +//recursively find a file... - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); +var find = exports.find = function () { + var rel = path.join.apply(null, [].slice.call(arguments)) - return [l, a, b]; -}; + function find(start, rel) { + var file = path.join(start, rel) + try { + fs.statSync(file) + return file + } catch (err) { + if(path.dirname(start) !== start) // root + return find(path.dirname(start), rel) + } + } + return find(__dirname, rel) +} -convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; +var parse = exports.parse = function (content, file, type) { + content = '' + content + // if we don't know what it is, try json and fall back to ini + // if we know what it is, then it must be that. + if (!type) { + try { return JSON.parse(content) } + catch (er) { return ini.parse(content) } + } else if (type === 'json') { + if (this.emit) { + try { return JSON.parse(content) } + catch (er) { this.emit('error', er) } + } else { + return JSON.parse(content) + } + } else { + return ini.parse(content) + } +} - if (s === 0) { - val = l * 255; - return [val, val, val]; - } +var json = exports.json = function () { + var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) + var file = path.join.apply(null, args) + var content + try { + content = fs.readFileSync(file,'utf-8') + } catch (err) { + return + } + return parse(content, file, 'json') +} - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } +var env = exports.env = function (prefix, env) { + env = env || process.env + var obj = {} + var l = prefix.length + for(var k in env) { + if(k.indexOf(prefix) === 0) + obj[k.substring(l)] = env[k] + } - const t1 = 2 * l - t2; + return obj +} - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } +exports.ConfigChain = ConfigChain +function ConfigChain () { + EE.apply(this) + ProtoList.apply(this, arguments) + this._awaiting = 0 + this._saving = 0 + this.sources = {} +} - if (t3 > 1) { - t3--; - } +// multi-inheritance-ish +var extras = { + constructor: { value: ConfigChain } +} +Object.keys(EE.prototype).forEach(function (k) { + extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k) +}) +ConfigChain.prototype = Object.create(ProtoList.prototype, extras) - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } +ConfigChain.prototype.del = function (key, where) { + // if not specified where, then delete from the whole chain, scorched + // earth style + if (where) { + var target = this.sources[where] + target = target && target.data + if (!target) { + return this.emit('error', new Error('not found '+where)) + } + delete target[key] + } else { + for (var i = 0, l = this.list.length; i < l; i ++) { + delete this.list[i][key] + } + } + return this +} - rgb[i] = val * 255; - } +ConfigChain.prototype.set = function (key, value, where) { + var target - return rgb; -}; + if (where) { + target = this.sources[where] + target = target && target.data + if (!target) { + return this.emit('error', new Error('not found '+where)) + } + } else { + target = this.list[0] + if (!target) { + return this.emit('error', new Error('cannot set, no confs!')) + } + } + target[key] = value + return this +} -convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); +ConfigChain.prototype.get = function (key, where) { + if (where) { + where = this.sources[where] + if (where) where = where.data + if (where && Object.hasOwnProperty.call(where, key)) return where[key] + return undefined + } + return this.list[0][key] +} - l *= 2; - s *= (l <= 1) ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); +ConfigChain.prototype.save = function (where, type, cb) { + if (typeof type === 'function') cb = type, type = null + var target = this.sources[where] + if (!target || !(target.path || target.source) || !target.data) { + // TODO: maybe save() to a url target could be a PUT or something? + // would be easy to swap out with a reddis type thing, too + return this.emit('error', new Error('bad save target: '+where)) + } - return [h, sv * 100, v * 100]; -}; + if (target.source) { + var pref = target.prefix || '' + Object.keys(target.data).forEach(function (k) { + target.source[pref + k] = target.data[k] + }) + return this + } -convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; + var type = type || target.type + var data = target.data + if (target.type === 'json') { + data = JSON.stringify(data) + } else { + data = ini.stringify(data) + } - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); - v *= 255; + this._saving ++ + fs.writeFile(target.path, data, 'utf8', function (er) { + this._saving -- + if (er) { + if (cb) return cb(er) + else return this.emit('error', er) + } + if (this._saving === 0) { + if (cb) cb() + this.emit('save') + } + }.bind(this)) + return this +} - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } -}; +ConfigChain.prototype.addFile = function (file, type, name) { + name = name || file + var marker = {__source__:name} + this.sources[name] = { path: file, type: type } + this.push(marker) + this._await() + fs.readFile(file, 'utf8', function (er, data) { + if (er) this.emit('error', er) + this.addString(data, file, type, marker) + }.bind(this)) + return this +} -convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; +ConfigChain.prototype.addEnv = function (prefix, env, name) { + name = name || 'env' + var data = exports.env(prefix, env) + this.sources[name] = { data: data, source: env, prefix: prefix } + return this.add(data, name) +} - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= (lmin <= 1) ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; +ConfigChain.prototype.addUrl = function (req, type, name) { + this._await() + var href = url.format(req) + name = name || href + var marker = {__source__:name} + this.sources[name] = { href: href, type: type } + this.push(marker) + http.request(req, function (res) { + var c = [] + var ct = res.headers['content-type'] + if (!type) { + type = ct.indexOf('json') !== -1 ? 'json' + : ct.indexOf('ini') !== -1 ? 'ini' + : href.match(/\.json$/) ? 'json' + : href.match(/\.ini$/) ? 'ini' + : null + marker.type = type + } - return [h, sl * 100, l * 100]; -}; + res.on('data', c.push.bind(c)) + .on('end', function () { + this.addString(Buffer.concat(c), href, type, marker) + }.bind(this)) + .on('error', this.emit.bind(this, 'error')) -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; + }.bind(this)) + .on('error', this.emit.bind(this, 'error')) + .end() - // Wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } + return this +} - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; +ConfigChain.prototype.addString = function (data, file, type, marker) { + data = this.parse(data, file, type) + this.add(data, marker) + return this +} - if ((i & 0x01) !== 0) { - f = 1 - f; - } - - const n = wh + f * (v - wh); // Linear interpolation +ConfigChain.prototype.add = function (data, marker) { + if (marker && typeof marker === 'object') { + var i = this.list.indexOf(marker) + if (i === -1) { + return this.emit('error', new Error('bad marker')) + } + this.splice(i, 1, data) + marker = marker.__source__ + this.sources[marker] = this.sources[marker] || {} + this.sources[marker].data = data + // we were waiting for this. maybe emit 'load' + this._resolve() + } else { + if (typeof marker === 'string') { + this.sources[marker] = this.sources[marker] || {} + this.sources[marker].data = data + } + // trigger the load event if nothing was already going to do so. + this._await() + this.push(data) + process.nextTick(this._resolve.bind(this)) + } + return this +} - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - /* eslint-enable max-statements-per-line,no-multi-spaces */ +ConfigChain.prototype.parse = exports.parse - return [r * 255, g * 255, b * 255]; -}; +ConfigChain.prototype._await = function () { + this._awaiting++ +} -convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; +ConfigChain.prototype._resolve = function () { + this._awaiting-- + if (this._awaiting === 0) this.emit('load', this) +} - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); - return [r * 255, g * 255, b * 255]; -}; +/***/ }), -convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; +/***/ 23875: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); +"use strict"; - // Assume sRGB - r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) - : r * 12.92; - g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) - : g * 12.92; +const cp = __nccwpck_require__(63129); +const parse = __nccwpck_require__(4915); +const enoent = __nccwpck_require__(39985); - b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) - : b * 12.92; +function spawn(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); + // Spawn the child process + const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); - return [r * 255, g * 255, b * 255]; -}; + // Hook into child process "exit" event to emit an error if the command + // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + enoent.hookChildProcess(spawned, parsed); -convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; + return spawned; +} - x /= 95.047; - y /= 100; - z /= 108.883; +function spawnSync(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + // Spawn the child process + const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); + // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); - return [l, a, b]; -}; + return result; +} -convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; +module.exports._parse = parse; +module.exports._enoent = enoent; - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - x *= 95.047; - y *= 100; - z *= 108.883; +/***/ }), - return [x, y, z]; -}; +/***/ 39985: +/***/ ((module) => { -convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; +"use strict"; - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - if (h < 0) { - h += 360; - } +const isWin = process.platform === 'win32'; - const c = Math.sqrt(a * a + b * b); +function notFoundError(original, syscall) { + return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { + code: 'ENOENT', + errno: 'ENOENT', + syscall: `${syscall} ${original.command}`, + path: original.command, + spawnargs: original.args, + }); +} - return [l, c, h]; -}; +function hookChildProcess(cp, parsed) { + if (!isWin) { + return; + } -convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; + const originalEmit = cp.emit; - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); + cp.emit = function (name, arg1) { + // If emitting "exit" event and exit code is 1, we need to check if + // the command exists and emit an "error" instead + // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 + if (name === 'exit') { + const err = verifyENOENT(arg1, parsed, 'spawn'); - return [l, a, b]; -}; + if (err) { + return originalEmit.call(cp, 'error', err); + } + } -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization + return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params + }; +} - value = Math.round(value / 50); +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); + } - if (value === 0) { - return 30; - } + return null; +} - let ansi = 30 - + ((Math.round(b / 255) << 2) - | (Math.round(g / 255) << 1) - | Math.round(r / 255)); +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } - if (value === 2) { - ansi += 60; - } + return null; +} - return ansi; +module.exports = { + hookChildProcess, + verifyENOENT, + verifyENOENTSync, + notFoundError, }; -convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get - // it converted for us. - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); -}; -convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; +/***/ }), - // We use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (r === g && g === b) { - if (r < 8) { - return 16; - } +/***/ 4915: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (r > 248) { - return 231; - } +"use strict"; - return Math.round(((r - 8) / 247) * 24) + 232; - } - const ansi = 16 - + (36 * Math.round(r / 255 * 5)) - + (6 * Math.round(g / 255 * 5)) - + Math.round(b / 255 * 5); +const path = __nccwpck_require__(85622); +const resolveCommand = __nccwpck_require__(75921); +const escape = __nccwpck_require__(22266); +const readShebang = __nccwpck_require__(15217); - return ansi; -}; +const isWin = process.platform === 'win32'; +const isExecutableRegExp = /\.(?:com|exe)$/i; +const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; -convert.ansi16.rgb = function (args) { - let color = args % 10; +function detectShebang(parsed) { + parsed.file = resolveCommand(parsed); - // Handle greyscale - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } + const shebang = parsed.file && readShebang(parsed.file); - color = color / 10.5 * 255; + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; - return [color, color, color]; - } + return resolveCommand(parsed); + } - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; + return parsed.file; +} - return [r, g, b]; -}; +function parseNonShell(parsed) { + if (!isWin) { + return parsed; + } -convert.ansi256.rgb = function (args) { - // Handle greyscale - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } + // Detect & add support for shebangs + const commandFile = detectShebang(parsed); - args -= 16; + // We don't need a shell if the command filename is an executable + const needsShell = !isExecutableRegExp.test(commandFile); - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; + // If a shell is required, use cmd.exe and take care of escaping everything correctly + // Note that `forceShell` is an hidden option used only in tests + if (parsed.options.forceShell || needsShell) { + // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` + // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument + // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, + // we need to double escape them + const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - return [r, g, b]; -}; + // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) + // This is necessary otherwise it will always fail with ENOENT in those cases + parsed.command = path.normalize(parsed.command); -convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) - + ((Math.round(args[1]) & 0xFF) << 8) - + (Math.round(args[2]) & 0xFF); + // Escape command & arguments + parsed.command = escape.command(parsed.command); + parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; + const shellCommand = [parsed.command].concat(parsed.args).join(' '); -convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } + parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; + parsed.command = process.env.comspec || 'cmd.exe'; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } - let colorString = match[0]; + return parsed; +} - if (match[0].length === 3) { - colorString = colorString.split('').map(char => { - return char + char; - }).join(''); - } +function parse(command, args, options) { + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; + } - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = Object.assign({}, options); // Clone object to avoid changing the original - return [r, g, b]; -}; + // Build our parsed object + const parsed = { + command, + args, + options, + file: undefined, + original: { + command, + args, + }, + }; -convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; + // Delegate further parsing to shell or non-shell + return options.shell ? parsed : parseNonShell(parsed); +} - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } +module.exports = parse; - if (chroma <= 0) { - hue = 0; - } else - if (max === r) { - hue = ((g - b) / chroma) % 6; - } else - if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - hue /= 6; - hue %= 1; +/***/ }), - return [hue * 360, chroma * 100, grayscale * 100]; -}; +/***/ 22266: +/***/ ((module) => { -convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; +"use strict"; - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - let f = 0; - if (c < 1.0) { - f = (l - 0.5 * c) / (1.0 - c); - } +// See http://www.robvanderwoude.com/escapechars.php +const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; - return [hsl[0], c * 100, f * 100]; -}; +function escapeCommand(arg) { + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); -convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; + return arg; +} - const c = s * v; - let f = 0; +function escapeArgument(arg, doubleEscapeMetaChars) { + // Convert to string + arg = `${arg}`; - if (c < 1.0) { - f = (v - c) / (1 - c); - } + // Algorithm below is based on https://qntm.org/cmd - return [hsv[0], c * 100, f * 100]; -}; + // Sequence of backslashes followed by a double quote: + // double up all the backslashes and escape the double quote + arg = arg.replace(/(\\*)"/g, '$1$1\\"'); -convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; + // Sequence of backslashes followed by the end of the string + // (which will become a double quote later): + // double up all the backslashes + arg = arg.replace(/(\\*)$/, '$1$1'); - if (c === 0.0) { - return [g * 255, g * 255, g * 255]; - } + // All other backslashes occur literally - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; + // Quote the whole thing: + arg = `"${arg}"`; - /* eslint-disable max-statements-per-line */ - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; pure[1] = v; pure[2] = 0; break; - case 1: - pure[0] = w; pure[1] = 1; pure[2] = 0; break; - case 2: - pure[0] = 0; pure[1] = 1; pure[2] = v; break; - case 3: - pure[0] = 0; pure[1] = w; pure[2] = 1; break; - case 4: - pure[0] = v; pure[1] = 0; pure[2] = 1; break; - default: - pure[0] = 1; pure[1] = 0; pure[2] = w; - } - /* eslint-enable max-statements-per-line */ + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); - mg = (1.0 - c) * g; + // Double escape meta chars if necessary + if (doubleEscapeMetaChars) { + arg = arg.replace(metaCharsRegExp, '^$1'); + } - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; -}; + return arg; +} -convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; +module.exports.command = escapeCommand; +module.exports.argument = escapeArgument; - const v = c + g * (1.0 - c); - let f = 0; - if (v > 0.0) { - f = c / v; - } - - return [hcg[0], f * 100, v * 100]; -}; - -convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; +/***/ }), - if (l > 0.0 && l < 0.5) { - s = c / (2 * l); - } else - if (l >= 0.5 && l < 1.0) { - s = c / (2 * (1 - l)); - } +/***/ 15217: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return [hcg[0], s * 100, l * 100]; -}; +"use strict"; -convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; -}; -convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; +const fs = __nccwpck_require__(35747); +const shebangCommand = __nccwpck_require__(95598); - if (c < 1) { - g = (v - c) / (1 - c); - } +function readShebang(command) { + // Read the first 150 bytes from the file + const size = 150; + const buffer = Buffer.alloc(size); - return [hwb[0], c * 100, g * 100]; -}; + let fd; -convert.apple.rgb = function (apple) { - return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; -}; + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, size, 0); + fs.closeSync(fd); + } catch (e) { /* Empty */ } -convert.rgb.apple = function (rgb) { - return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; -}; + // Attempt to extract shebang (null is returned if not a shebang) + return shebangCommand(buffer.toString()); +} -convert.gray.rgb = function (args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; -}; +module.exports = readShebang; -convert.gray.hsl = function (args) { - return [0, 0, args[0]]; -}; -convert.gray.hsv = convert.gray.hsl; +/***/ }), -convert.gray.hwb = function (gray) { - return [0, 100, gray[0]]; -}; +/***/ 75921: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -convert.gray.cmyk = function (gray) { - return [0, 0, 0, gray[0]]; -}; +"use strict"; -convert.gray.lab = function (gray) { - return [gray[0], 0, 0]; -}; -convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; +const path = __nccwpck_require__(85622); +const which = __nccwpck_require__(67753); +const getPathKey = __nccwpck_require__(37637); - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; +function resolveCommandAttempt(parsed, withoutPathExt) { + const env = parsed.options.env || process.env; + const cwd = process.cwd(); + const hasCustomCwd = parsed.options.cwd != null; + // Worker threads do not have process.chdir() + const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; -convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; -}; + // If a custom `cwd` was specified, we need to change the process cwd + // because `which` will do stat calls but does not support a custom cwd + if (shouldSwitchCwd) { + try { + process.chdir(parsed.options.cwd); + } catch (err) { + /* Empty */ + } + } + let resolved; -/***/ }), + try { + resolved = which.sync(parsed.command, { + path: env[getPathKey({ env })], + pathExt: withoutPathExt ? path.delimiter : undefined, + }); + } catch (e) { + /* Empty */ + } finally { + if (shouldSwitchCwd) { + process.chdir(cwd); + } + } -/***/ 73991: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // If we successfully resolved, ensure that an absolute path is returned + // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it + if (resolved) { + resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); + } -const conversions = __webpack_require__(92724); -const route = __webpack_require__(40577); + return resolved; +} -const convert = {}; +function resolveCommand(parsed) { + return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); +} -const models = Object.keys(conversions); +module.exports = resolveCommand; -function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; - } - if (arg0.length > 1) { - args = arg0; - } +/***/ }), - return fn(args); - }; +/***/ 12369: +/***/ ((module, exports, __nccwpck_require__) => { - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } +/* eslint-env browser */ - return wrappedFn; -} +/** + * This is the web browser implementation of `debug()`. + */ -function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; - if (arg0 === undefined || arg0 === null) { - return arg0; + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } + }; +})(); - if (arg0.length > 1) { - args = arg0; - } +/** + * Colors. + */ - const result = fn(args); +exports.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' +]; - // We're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ - return result; - }; +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; } - return wrappedFn; + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } -models.forEach(fromModel => { - convert[fromModel] = {}; +/** + * Colorize log arguments if enabled. + * + * @api public + */ - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); - const routes = route(fromModel); - const routeModels = Object.keys(routes); + if (!this.useColors) { + return; + } - routeModels.forEach(toModel => { - const fn = routes[toModel]; + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } }); -}); - -module.exports = convert; - - -/***/ }), - -/***/ 40577: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const conversions = __webpack_require__(92724); - -/* - This function routes a model to all other models. - - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). - conversions that are not possible simply are not included. -*/ + args.splice(lastC, 0, c); +} -function buildGraph() { - const graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? } - - return graph; } -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop - - graph[fromModel].distance = 0; - - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? } - return graph; -} + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } -function link(from, to) { - return function (args) { - return to(from(args)); - }; + return r; } -function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? } - - fn.conversion = path; - return fn; } -module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; +module.exports = __nccwpck_require__(22507)(exports); - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; +const {formatters} = module.exports; - if (node.parent === null) { - // No possible conversion, or this node is the source model. - continue; - } +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ - conversion[toModel] = wrapConversion(toModel, graph); +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; } - - return conversion; }; - /***/ }), -/***/ 78679: -/***/ ((module) => { +/***/ 22507: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ -module.exports = { - "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] -}; +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(84004); + createDebug.destroy = destroy; + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); -/***/ }), + /** + * The currently active debug mode names, and names to skip. + */ -/***/ 28192: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + createDebug.names = []; + createDebug.skips = []; -var path = __webpack_require__(85622); + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; -module.exports = function (basedir, relfiles) { - if (relfiles) { - var files = relfiles.map(function (r) { - return path.resolve(basedir, r); - }); - } - else { - var files = basedir; - } - - var res = files.slice(1).reduce(function (ps, file) { - if (!file.match(/^([A-Za-z]:)?\/|\\/)) { - throw new Error('relative path without a basedir'); - } - - var xs = file.split(/\/+|\\+/); - for ( - var i = 0; - ps[i] === xs[i] && i < Math.min(ps.length, xs.length); - i++ - ); - return ps.slice(0, i); - }, files[0].split(/\/+|\\+/)); - - // Windows correctly handles paths with forward-slashes - return res.length > 1 ? res.join('/') : '/' -}; + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } -/***/ }), + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; -/***/ 45179: -/***/ ((module) => { + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; + const self = debug; + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; -/***/ }), + args[0] = createDebug.coerce(args[0]); -/***/ 18271: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } -var ProtoList = __webpack_require__(98051) - , path = __webpack_require__(85622) - , fs = __webpack_require__(35747) - , ini = __webpack_require__(27452) - , EE = __webpack_require__(28614).EventEmitter - , url = __webpack_require__(78835) - , http = __webpack_require__(98605) + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); -var exports = module.exports = function () { - var args = [].slice.call(arguments) - , conf = new ConfigChain() + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); - while(args.length) { - var a = args.shift() - if(a) conf.push - ( 'string' === typeof a - ? json(a) - : a ) - } + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); - return conf -} + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } -//recursively find a file... + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. -var find = exports.find = function () { - var rel = path.join.apply(null, [].slice.call(arguments)) + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, + set: v => { + enableOverride = v; + } + }); - function find(start, rel) { - var file = path.join(start, rel) - try { - fs.statSync(file) - return file - } catch (err) { - if(path.dirname(start) !== start) // root - return find(path.dirname(start), rel) - } - } - return find(__dirname, rel) -} + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } -var parse = exports.parse = function (content, file, type) { - content = '' + content - // if we don't know what it is, try json and fall back to ini - // if we know what it is, then it must be that. - if (!type) { - try { return JSON.parse(content) } - catch (er) { return ini.parse(content) } - } else if (type === 'json') { - if (this.emit) { - try { return JSON.parse(content) } - catch (er) { this.emit('error', er) } - } else { - return JSON.parse(content) - } - } else { - return ini.parse(content) - } -} + return debug; + } -var json = exports.json = function () { - var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) - var file = path.join.apply(null, args) - var content - try { - content = fs.readFileSync(file,'utf-8') - } catch (err) { - return - } - return parse(content, file, 'json') -} + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } -var env = exports.env = function (prefix, env) { - env = env || process.env - var obj = {} - var l = prefix.length - for(var k in env) { - if(k.indexOf(prefix) === 0) - obj[k.substring(l)] = env[k] - } + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); - return obj -} + createDebug.names = []; + createDebug.skips = []; -exports.ConfigChain = ConfigChain -function ConfigChain () { - EE.apply(this) - ProtoList.apply(this, arguments) - this._awaiting = 0 - this._saving = 0 - this.sources = {} -} + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; -// multi-inheritance-ish -var extras = { - constructor: { value: ConfigChain } -} -Object.keys(EE.prototype).forEach(function (k) { - extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k) -}) -ConfigChain.prototype = Object.create(ProtoList.prototype, extras) + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } -ConfigChain.prototype.del = function (key, where) { - // if not specified where, then delete from the whole chain, scorched - // earth style - if (where) { - var target = this.sources[where] - target = target && target.data - if (!target) { - return this.emit('error', new Error('not found '+where)) - } - delete target[key] - } else { - for (var i = 0, l = this.list.length; i < l; i ++) { - delete this.list[i][key] - } - } - return this -} + namespaces = split[i].replace(/\*/g, '.*?'); -ConfigChain.prototype.set = function (key, value, where) { - var target + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } - if (where) { - target = this.sources[where] - target = target && target.data - if (!target) { - return this.emit('error', new Error('not found '+where)) - } - } else { - target = this.list[0] - if (!target) { - return this.emit('error', new Error('cannot set, no confs!')) - } - } - target[key] = value - return this -} + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } -ConfigChain.prototype.get = function (key, where) { - if (where) { - where = this.sources[where] - if (where) where = where.data - if (where && Object.hasOwnProperty.call(where, key)) return where[key] - return undefined - } - return this.list[0][key] -} + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } -ConfigChain.prototype.save = function (where, type, cb) { - if (typeof type === 'function') cb = type, type = null - var target = this.sources[where] - if (!target || !(target.path || target.source) || !target.data) { - // TODO: maybe save() to a url target could be a PUT or something? - // would be easy to swap out with a reddis type thing, too - return this.emit('error', new Error('bad save target: '+where)) - } + let i; + let len; - if (target.source) { - var pref = target.prefix || '' - Object.keys(target.data).forEach(function (k) { - target.source[pref + k] = target.data[k] - }) - return this - } + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } - var type = type || target.type - var data = target.data - if (target.type === 'json') { - data = JSON.stringify(data) - } else { - data = ini.stringify(data) - } + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } - this._saving ++ - fs.writeFile(target.path, data, 'utf8', function (er) { - this._saving -- - if (er) { - if (cb) return cb(er) - else return this.emit('error', er) - } - if (this._saving === 0) { - if (cb) cb() - this.emit('save') - } - }.bind(this)) - return this -} + return false; + } -ConfigChain.prototype.addFile = function (file, type, name) { - name = name || file - var marker = {__source__:name} - this.sources[name] = { path: file, type: type } - this.push(marker) - this._await() - fs.readFile(file, 'utf8', function (er, data) { - if (er) this.emit('error', er) - this.addString(data, file, type, marker) - }.bind(this)) - return this -} + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } -ConfigChain.prototype.addEnv = function (prefix, env, name) { - name = name || 'env' - var data = exports.env(prefix, env) - this.sources[name] = { data: data, source: env, prefix: prefix } - return this.add(data, name) -} - -ConfigChain.prototype.addUrl = function (req, type, name) { - this._await() - var href = url.format(req) - name = name || href - var marker = {__source__:name} - this.sources[name] = { href: href, type: type } - this.push(marker) - http.request(req, function (res) { - var c = [] - var ct = res.headers['content-type'] - if (!type) { - type = ct.indexOf('json') !== -1 ? 'json' - : ct.indexOf('ini') !== -1 ? 'ini' - : href.match(/\.json$/) ? 'json' - : href.match(/\.ini$/) ? 'ini' - : null - marker.type = type - } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } - res.on('data', c.push.bind(c)) - .on('end', function () { - this.addString(Buffer.concat(c), href, type, marker) - }.bind(this)) - .on('error', this.emit.bind(this, 'error')) + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } - }.bind(this)) - .on('error', this.emit.bind(this, 'error')) - .end() + createDebug.enable(createDebug.load()); - return this + return createDebug; } -ConfigChain.prototype.addString = function (data, file, type, marker) { - data = this.parse(data, file, type) - this.add(data, marker) - return this -} +module.exports = setup; -ConfigChain.prototype.add = function (data, marker) { - if (marker && typeof marker === 'object') { - var i = this.list.indexOf(marker) - if (i === -1) { - return this.emit('error', new Error('bad marker')) - } - this.splice(i, 1, data) - marker = marker.__source__ - this.sources[marker] = this.sources[marker] || {} - this.sources[marker].data = data - // we were waiting for this. maybe emit 'load' - this._resolve() - } else { - if (typeof marker === 'string') { - this.sources[marker] = this.sources[marker] || {} - this.sources[marker].data = data - } - // trigger the load event if nothing was already going to do so. - this._await() - this.push(data) - process.nextTick(this._resolve.bind(this)) - } - return this -} -ConfigChain.prototype.parse = exports.parse +/***/ }), -ConfigChain.prototype._await = function () { - this._awaiting++ -} +/***/ 30787: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -ConfigChain.prototype._resolve = function () { - this._awaiting-- - if (this._awaiting === 0) this.emit('load', this) +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(12369); +} else { + module.exports = __nccwpck_require__(72296); } /***/ }), -/***/ 23875: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const cp = __webpack_require__(63129); -const parse = __webpack_require__(4915); -const enoent = __webpack_require__(39985); +/***/ 72296: +/***/ ((module, exports, __nccwpck_require__) => { -function spawn(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); +/** + * Module dependencies. + */ - // Spawn the child process - const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); +const tty = __nccwpck_require__(33867); +const util = __nccwpck_require__(31669); - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); +/** + * This is the Node.js implementation of `debug()`. + */ - return spawned; -} +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); -function spawnSync(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); +/** + * Colors. + */ - // Spawn the child process - const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); +exports.colors = [6, 2, 3, 4, 5, 1]; - // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(28106); - return result; + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.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 (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. } -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; - -module.exports._parse = parse; -module.exports._enoent = enoent; - - -/***/ }), +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ -/***/ 39985: -/***/ ((module) => { +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); -"use strict"; + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + obj[prop] = val; + return obj; +}, {}); -const isWin = process.platform === 'win32'; +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ -function notFoundError(original, syscall) { - return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { - code: 'ENOENT', - errno: 'ENOENT', - syscall: `${syscall} ${original.command}`, - path: original.command, - spawnargs: original.args, - }); +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); } -function hookChildProcess(cp, parsed) { - if (!isWin) { - return; - } +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ - const originalEmit = cp.emit; +function formatArgs(args) { + const {namespace: name, useColors} = this; - cp.emit = function (name, arg1) { - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === 'exit') { - const err = verifyENOENT(arg1, parsed, 'spawn'); + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; - if (err) { - return originalEmit.call(cp, 'error', err); - } - } + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} - return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params - }; +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; } -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); - } +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ - return null; +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); } -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} - return null; +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; } -module.exports = { - hookChildProcess, - verifyENOENT, - verifyENOENTSync, - notFoundError, -}; +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ +function init(debug) { + debug.inspectOpts = {}; -/***/ }), + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} -/***/ 4915: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +module.exports = __nccwpck_require__(22507)(exports); -"use strict"; +const {formatters} = module.exports; +/** + * Map %o to `util.inspect()`, all on a single line. + */ -const path = __webpack_require__(85622); -const resolveCommand = __webpack_require__(75921); -const escape = __webpack_require__(22266); -const readShebang = __webpack_require__(15217); +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; -const isWin = process.platform === 'win32'; -const isExecutableRegExp = /\.(?:com|exe)$/i; -const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ -function detectShebang(parsed) { - parsed.file = resolveCommand(parsed); +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; - const shebang = parsed.file && readShebang(parsed.file); - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; +/***/ }), - return resolveCommand(parsed); - } +/***/ 47781: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return parsed.file; -} +"use strict"; -function parseNonShell(parsed) { - if (!isWin) { - return parsed; - } +const PassThrough = __nccwpck_require__(92413).PassThrough; +const zlib = __nccwpck_require__(78761); +const mimicResponse = __nccwpck_require__(27480); - // Detect & add support for shebangs - const commandFile = detectShebang(parsed); +module.exports = response => { + // TODO: Use Array#includes when targeting Node.js 6 + if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) { + return response; + } - // We don't need a shell if the command filename is an executable - const needsShell = !isExecutableRegExp.test(commandFile); + const unzip = zlib.createUnzip(); + const stream = new PassThrough(); - // If a shell is required, use cmd.exe and take care of escaping everything correctly - // Note that `forceShell` is an hidden option used only in tests - if (parsed.options.forceShell || needsShell) { - // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` - // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument - // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, - // we need to double escape them - const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); + mimicResponse(response, stream); - // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) - // This is necessary otherwise it will always fail with ENOENT in those cases - parsed.command = path.normalize(parsed.command); + unzip.on('error', err => { + if (err.code === 'Z_BUF_ERROR') { + stream.end(); + return; + } - // Escape command & arguments - parsed.command = escape.command(parsed.command); - parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); + stream.emit('error', err); + }); - const shellCommand = [parsed.command].concat(parsed.args).join(' '); + response.pipe(unzip).pipe(stream); - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.command = process.env.comspec || 'cmd.exe'; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } + return stream; +}; - return parsed; -} -function parse(command, args, options) { - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } +/***/ }), - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = Object.assign({}, options); // Clone object to avoid changing the original +/***/ 36250: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Build our parsed object - const parsed = { - command, - args, - options, - file: undefined, - original: { - command, - args, - }, - }; +var clone = __nccwpck_require__(13405); - // Delegate further parsing to shell or non-shell - return options.shell ? parsed : parseNonShell(parsed); -} +module.exports = function(options, defaults) { + options = options || {}; -module.exports = parse; + Object.keys(defaults).forEach(function(key) { + if (typeof options[key] === 'undefined') { + options[key] = clone(defaults[key]); + } + }); + return options; +}; /***/ }), -/***/ 22266: -/***/ ((module) => { +/***/ 12097: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tls_1 = __nccwpck_require__(4016); +const deferToConnect = (socket, fn) => { + let listeners; + if (typeof fn === 'function') { + const connect = fn; + listeners = { connect }; + } + else { + listeners = fn; + } + const hasConnectListener = typeof listeners.connect === 'function'; + const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; + const hasCloseListener = typeof listeners.close === 'function'; + const onConnect = () => { + if (hasConnectListener) { + listeners.connect(); + } + if (socket instanceof tls_1.TLSSocket && hasSecureConnectListener) { + if (socket.authorized) { + listeners.secureConnect(); + } + else if (!socket.authorizationError) { + socket.once('secureConnect', listeners.secureConnect); + } + } + if (hasCloseListener) { + socket.once('close', listeners.close); + } + }; + if (socket.writable && !socket.connecting) { + onConnect(); + } + else if (socket.connecting) { + socket.once('connect', onConnect); + } + else if (socket.destroyed && hasCloseListener) { + listeners.close(socket._hadError); + } +}; +exports.default = deferToConnect; +// For CommonJS default export support +module.exports = deferToConnect; +module.exports.default = deferToConnect; -// See http://www.robvanderwoude.com/escapechars.php -const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; - -function escapeCommand(arg) { - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - return arg; -} - -function escapeArgument(arg, doubleEscapeMetaChars) { - // Convert to string - arg = `${arg}`; - - // Algorithm below is based on https://qntm.org/cmd - - // Sequence of backslashes followed by a double quote: - // double up all the backslashes and escape the double quote - arg = arg.replace(/(\\*)"/g, '$1$1\\"'); - - // Sequence of backslashes followed by the end of the string - // (which will become a double quote later): - // double up all the backslashes - arg = arg.replace(/(\\*)$/, '$1$1'); - - // All other backslashes occur literally - // Quote the whole thing: - arg = `"${arg}"`; +/***/ }), - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); +/***/ 47778: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Double escape meta chars if necessary - if (doubleEscapeMetaChars) { - arg = arg.replace(metaCharsRegExp, '^$1'); - } +"use strict"; - return arg; -} -module.exports.command = escapeCommand; -module.exports.argument = escapeArgument; +var keys = __nccwpck_require__(28777); +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; +var toStr = Object.prototype.toString; +var concat = Array.prototype.concat; +var origDefineProperty = Object.defineProperty; -/***/ }), +var isFunction = function (fn) { + return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; +}; -/***/ 15217: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var arePropertyDescriptorsSupported = function () { + var obj = {}; + try { + origDefineProperty(obj, 'x', { enumerable: false, value: obj }); + // eslint-disable-next-line no-unused-vars, no-restricted-syntax + for (var _ in obj) { // jscs:ignore disallowUnusedVariables + return false; + } + return obj.x === obj; + } catch (e) { /* this is IE 8. */ + return false; + } +}; +var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); -"use strict"; +var defineProperty = function (object, name, value, predicate) { + if (name in object && (!isFunction(predicate) || !predicate())) { + return; + } + if (supportsDescriptors) { + origDefineProperty(object, name, { + configurable: true, + enumerable: false, + value: value, + writable: true + }); + } else { + object[name] = value; + } +}; +var defineProperties = function (object, map) { + var predicates = arguments.length > 2 ? arguments[2] : {}; + var props = keys(map); + if (hasSymbols) { + props = concat.call(props, Object.getOwnPropertySymbols(map)); + } + for (var i = 0; i < props.length; i += 1) { + defineProperty(object, props[i], map[props[i]], predicates[props[i]]); + } +}; -const fs = __webpack_require__(35747); -const shebangCommand = __webpack_require__(95598); +defineProperties.supportsDescriptors = !!supportsDescriptors; -function readShebang(command) { - // Read the first 150 bytes from the file - const size = 150; - const buffer = Buffer.alloc(size); +module.exports = defineProperties; - let fd; - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, size, 0); - fs.closeSync(fd); - } catch (e) { /* Empty */ } +/***/ }), - // Attempt to extract shebang (null is returned if not a shebang) - return shebangCommand(buffer.toString()); -} +/***/ 7192: +/***/ ((module) => { -module.exports = readShebang; +// Only Node.JS has a process variable that is of [[Class]] process +module.exports = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; /***/ }), -/***/ 75921: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 71257: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const which = __webpack_require__(67753); -const getPathKey = __webpack_require__(23226); +var stream = __nccwpck_require__(92413); -function resolveCommandAttempt(parsed, withoutPathExt) { - const env = parsed.options.env || process.env; - const cwd = process.cwd(); - const hasCustomCwd = parsed.options.cwd != null; - // Worker threads do not have process.chdir() - const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; +function DuplexWrapper(options, writable, readable) { + if (typeof readable === "undefined") { + readable = writable; + writable = options; + options = null; + } - // If a custom `cwd` was specified, we need to change the process cwd - // because `which` will do stat calls but does not support a custom cwd - if (shouldSwitchCwd) { - try { - process.chdir(parsed.options.cwd); - } catch (err) { - /* Empty */ - } - } + stream.Duplex.call(this, options); - let resolved; + if (typeof readable.read !== "function") { + readable = (new stream.Readable(options)).wrap(readable); + } - try { - resolved = which.sync(parsed.command, { - path: env[getPathKey({ env })], - pathExt: withoutPathExt ? path.delimiter : undefined, - }); - } catch (e) { - /* Empty */ - } finally { - if (shouldSwitchCwd) { - process.chdir(cwd); - } - } + this._writable = writable; + this._readable = readable; + this._waiting = false; - // If we successfully resolved, ensure that an absolute path is returned - // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it - if (resolved) { - resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); + var self = this; + + writable.once("finish", function() { + self.end(); + }); + + this.once("finish", function() { + writable.end(); + }); + + readable.on("readable", function() { + if (self._waiting) { + self._waiting = false; + self._read(); } + }); - return resolved; -} + readable.once("end", function() { + self.push(null); + }); -function resolveCommand(parsed) { - return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); + if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { + writable.on("error", function(err) { + self.emit("error", err); + }); + + readable.on("error", function(err) { + self.emit("error", err); + }); + } } -module.exports = resolveCommand; +DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); +DuplexWrapper.prototype._write = function _write(input, encoding, done) { + this._writable.write(input, encoding, done); +}; -/***/ }), +DuplexWrapper.prototype._read = function _read() { + var buf; + var reads = 0; + while ((buf = this._readable.read()) !== null) { + this.push(buf); + reads++; + } + if (reads === 0) { + this._waiting = true; + } +}; -/***/ 23226: -/***/ ((module) => { +module.exports = function duplex2(options, writable, readable) { + return new DuplexWrapper(options, writable, readable); +}; -"use strict"; +module.exports.DuplexWrapper = DuplexWrapper; -const pathKey = (options = {}) => { - const environment = options.env || process.env; - const platform = options.platform || process.platform; +/***/ }), - if (platform !== 'win32') { - return 'PATH'; - } +/***/ 33874: +/***/ ((module) => { - return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; -}; +"use strict"; +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ -module.exports = pathKey; -// TODO: Remove this for the next major release -module.exports.default = pathKey; -/***/ }), +/** + * Module exports. + * @public + */ -/***/ 12369: -/***/ ((module, exports, __webpack_require__) => { +module.exports = encodeUrl -/* eslint-env browser */ +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g /** - * This is the web browser implementation of `debug()`. + * RegExp to match unmatched surrogate pair. + * @private */ -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g /** - * Colors. + * String to replace unmatched surrogate pair with. + * @private */ -exports.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' -]; +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' /** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. * - * TODO: add a `localStorage` variable to explicitly enable/disable colors + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public */ -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} +/***/ }), + +/***/ 85100: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var iconvLite = __nccwpck_require__(21377); + +// Expose to the world +module.exports.O = convert; /** - * Colorize log arguments if enabled. + * Convert encoding of an UTF-8 string or a buffer * - * @api public + * @param {String|Buffer} str String to be converted + * @param {String} to Encoding to be converted to + * @param {String} [from='UTF-8'] Encoding to be converted from + * @return {Buffer} Encoded string */ +function convert(str, to, from) { + from = checkEncoding(from || 'UTF-8'); + to = checkEncoding(to || 'UTF-8'); + str = str || ''; -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); + var result; - if (!this.useColors) { - return; - } + if (from !== 'UTF-8' && typeof str === 'string') { + str = Buffer.from(str, 'binary'); + } - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); + if (from === to) { + if (typeof str === 'string') { + result = Buffer.from(str); + } else { + result = str; + } + } else { + try { + result = convertIconvLite(str, to, from); + } catch (E) { + console.error(E); + result = str; + } + } - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); + if (typeof result === 'string') { + result = Buffer.from(result, 'utf-8'); + } - args.splice(lastC, 0, c); + return result; } /** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". + * Convert encoding of astring with iconv-lite * - * @api public + * @param {String|Buffer} str String to be converted + * @param {String} to Encoding to be converted to + * @param {String} [from='UTF-8'] Encoding to be converted from + * @return {Buffer} Encoded string */ -function log(...args) { - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return typeof console === 'object' && - console.log && - console.log(...args); +function convertIconvLite(str, to, from) { + if (to === 'UTF-8') { + return iconvLite.decode(str, from); + } else if (from === 'UTF-8') { + return iconvLite.encode(str, to); + } else { + return iconvLite.encode(iconvLite.decode(str, from), to); + } } /** - * Save `namespaces`. + * Converts charset name if needed * - * @param {String} namespaces - * @api private + * @param {String} name Character set + * @return {String} Character set name */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } +function checkEncoding(name) { + return (name || '') + .toString() + .trim() + .replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1') + .replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1') + .replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1') + .replace(/^ks_c_5601\-1987$/i, 'CP949') + .replace(/^us[\-_]?ascii$/i, 'ASCII') + .toUpperCase(); } -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } +/***/ }), - return r; -} +/***/ 11745: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ +var once = __nccwpck_require__(96754); -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} +var noop = function() {}; -module.exports = __webpack_require__(22507)(exports); +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; -const {formatters} = module.exports; +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; + callback = once(callback || noop); + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; -/***/ }), + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; -/***/ 22507: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __webpack_require__(84004); + var onerror = function(err) { + callback.call(stream, err); + }; - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); + var onclose = function() { + process.nextTick(onclosenexttick); + }; - /** - * Active `debug` instances. - */ - createDebug.instances = []; + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; - /** - * The currently active debug mode names, and names to skip. - */ + var onrequest = function() { + stream.req.on('finish', onfinish); + }; - createDebug.names = []; - createDebug.skips = []; + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; + if (isChildProcess(stream)) stream.on('exit', onexit); - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } + return function() { + cancelled = true; + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +}; - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; +module.exports = eos; - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } +/***/ }), - const self = debug; +/***/ 47727: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; +"use strict"; - args[0] = createDebug.coerce(args[0]); +const path = __nccwpck_require__(85622); +const os = __nccwpck_require__(12087); - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } +const homedir = os.homedir(); +const tmpdir = os.tmpdir(); +const {env} = process; - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return match; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); +const macos = name => { + const library = path.join(homedir, 'Library'); - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); + return { + data: path.join(library, 'Application Support', name), + config: path.join(library, 'Preferences', name), + cache: path.join(library, 'Caches', name), + log: path.join(library, 'Logs', name), + temp: path.join(tmpdir, name) + }; +}; - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); +const windows = name => { + const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming'); + const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local'); - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } + return { + // Data/config/cache/log are invented by me as Windows isn't opinionated about this + data: path.join(localAppData, name, 'Data'), + config: path.join(appData, name, 'Config'), + cache: path.join(localAppData, name, 'Cache'), + log: path.join(localAppData, name, 'Log'), + temp: path.join(tmpdir, name) + }; +}; - debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); - debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - debug.extend = extend; - // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; +// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +const linux = name => { + const username = path.basename(homedir); - // env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } + return { + data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), + config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), + cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), + // https://wiki.debian.org/XDGBaseDirectorySpecification#state + log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), + temp: path.join(tmpdir, username, name) + }; +}; - createDebug.instances.push(debug); +const envPaths = (name, options) => { + if (typeof name !== 'string') { + throw new TypeError(`Expected string, got ${typeof name}`); + } - return debug; + options = Object.assign({suffix: 'nodejs'}, options); + + if (options.suffix) { + // Add suffix to prevent possible conflict with native apps + name += `-${options.suffix}`; } - function destroy() { - const index = createDebug.instances.indexOf(this); - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - return false; + if (process.platform === 'darwin') { + return macos(name); } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; + if (process.platform === 'win32') { + return windows(name); } - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); + return linux(name); +}; - createDebug.names = []; - createDebug.skips = []; +module.exports = envPaths; +// TODO: Remove this for the next major release +module.exports.default = envPaths; - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } +/***/ }), - namespaces = split[i].replace(/\*/g, '.*?'); +/***/ 98361: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } +"use strict"; - for (i = 0; i < createDebug.instances.length; i++) { - const instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; +var util = __nccwpck_require__(31669); +var isArrayish = __nccwpck_require__(30237); + +var errorEx = function errorEx(name, properties) { + if (!name || name.constructor !== String) { + properties = name || {}; + name = Error.name; } - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; + var errorExError = function ErrorEXError(message) { + if (!this) { + return new ErrorEXError(message); } - let i; - let len; + message = message instanceof Error + ? message.message + : (message || this.message); - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } + Error.call(this, message); + Error.captureStackTrace(this, errorExError); - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } + this.name = name; - return false; - } + Object.defineProperty(this, 'message', { + configurable: true, + enumerable: false, + get: function () { + var newMessage = message.split(/\r?\n/g); - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } + var modifier = properties[key]; - createDebug.enable(createDebug.load()); + if ('message' in modifier) { + newMessage = modifier.message(this[key], newMessage) || newMessage; + if (!isArrayish(newMessage)) { + newMessage = [newMessage]; + } + } + } - return createDebug; -} + return newMessage.join('\n'); + }, + set: function (v) { + message = v; + } + }); -module.exports = setup; + var overwrittenStack = null; + var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); + var stackGetter = stackDescriptor.get; + var stackValue = stackDescriptor.value; + delete stackDescriptor.value; + delete stackDescriptor.writable; -/***/ }), + stackDescriptor.set = function (newstack) { + overwrittenStack = newstack; + }; -/***/ 30787: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + stackDescriptor.get = function () { + var stack = (overwrittenStack || ((stackGetter) + ? stackGetter.call(this) + : stackValue)).split(/\r?\n+/g); -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ + // starting in Node 7, the stack builder caches the message. + // just replace it. + if (!overwrittenStack) { + stack[0] = this.name + ': ' + this.message; + } -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __webpack_require__(12369); -} else { - module.exports = __webpack_require__(72296); -} + var lineCount = 1; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } + var modifier = properties[key]; -/***/ }), + if ('line' in modifier) { + var line = modifier.line(this[key]); + if (line) { + stack.splice(lineCount++, 0, ' ' + line); + } + } -/***/ 72296: -/***/ ((module, exports, __webpack_require__) => { + if ('stack' in modifier) { + modifier.stack(this[key], stack); + } + } -/** - * Module dependencies. - */ + return stack.join('\n'); + }; -const tty = __webpack_require__(33867); -const util = __webpack_require__(31669); + Object.defineProperty(this, 'stack', stackDescriptor); + }; -/** - * This is the Node.js implementation of `debug()`. - */ + if (Object.setPrototypeOf) { + Object.setPrototypeOf(errorExError.prototype, Error.prototype); + Object.setPrototypeOf(errorExError, Error); + } else { + util.inherits(errorExError, Error); + } -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; + return errorExError; +}; -/** - * Colors. - */ +errorEx.append = function (str, def) { + return { + message: function (v, message) { + v = v || def; -exports.colors = [6, 2, 3, 4, 5, 1]; + if (v) { + message[0] += ' ' + str.replace('%s', v.toString()); + } -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __webpack_require__(28106); + return message; + } + }; +}; - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.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 (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} +errorEx.line = function (str, def) { + return { + line: function (v) { + v = v || def; -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ + if (v) { + return str.replace('%s', v.toString()); + } -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); + return null; + } + }; +}; - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } +module.exports = errorEx; - obj[prop] = val; - return obj; -}, {}); -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ +/***/ }), -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} +/***/ 65393: +/***/ ((module, exports) => { -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ +"use strict"; -function formatArgs(args) { - const {namespace: name, useColors} = this; - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); -} +function _extendableBuiltin(cls) { + function ExtendableBuiltin() { + cls.apply(this, arguments); + } -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} + ExtendableBuiltin.prototype = Object.create(cls.prototype, { + constructor: { + value: cls, + enumerable: false, + writable: true, + configurable: true + } + }); -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ + if (Object.setPrototypeOf) { + Object.setPrototypeOf(ExtendableBuiltin, cls); + } else { + ExtendableBuiltin.__proto__ = cls; + } -function load() { - return process.env.DEBUG; + return ExtendableBuiltin; } -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ +var ExtendableError = function (_extendableBuiltin2) { + _inherits(ExtendableError, _extendableBuiltin2); -function init(debug) { - debug.inspectOpts = {}; + function ExtendableError() { + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} + _classCallCheck(this, ExtendableError); -module.exports = __webpack_require__(22507)(exports); + // extending Error is weird and does not propagate `message` + var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); -const {formatters} = module.exports; + Object.defineProperty(_this, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }); -/** - * Map %o to `util.inspect()`, all on a single line. - */ + Object.defineProperty(_this, 'name', { + configurable: true, + enumerable: false, + value: _this.constructor.name, + writable: true + }); -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .replace(/\s*\n\s*/g, ' '); -}; + if (Error.hasOwnProperty('captureStackTrace')) { + Error.captureStackTrace(_this, _this.constructor); + return _possibleConstructorReturn(_this); + } -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ + Object.defineProperty(_this, 'stack', { + configurable: true, + enumerable: false, + value: new Error(message).stack, + writable: true + }); + return _this; + } -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; + return ExtendableError; +}(_extendableBuiltin(Error)); + +exports.default = ExtendableError; +module.exports = exports['default']; /***/ }), -/***/ 47781: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 5813: +/***/ ((module) => { "use strict"; -const PassThrough = __webpack_require__(92413).PassThrough; -const zlib = __webpack_require__(78761); -const mimicResponse = __webpack_require__(27480); - -module.exports = response => { - // TODO: Use Array#includes when targeting Node.js 6 - if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) { - return response; - } - - const unzip = zlib.createUnzip(); - const stream = new PassThrough(); - - mimicResponse(response, stream); - - unzip.on('error', err => { - if (err.code === 'Z_BUF_ERROR') { - stream.end(); - return; - } - stream.emit('error', err); - }); +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - response.pipe(unzip).pipe(stream); +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } - return stream; + return str.replace(matchOperatorsRe, '\\$&'); }; /***/ }), -/***/ 36250: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var clone = __webpack_require__(13405); - -module.exports = function(options, defaults) { - options = options || {}; +/***/ 51737: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - Object.keys(defaults).forEach(function(key) { - if (typeof options[key] === 'undefined') { - options[key] = clone(defaults[key]); - } - }); +"use strict"; - return options; -}; +const path = __nccwpck_require__(85622); +const childProcess = __nccwpck_require__(63129); +const crossSpawn = __nccwpck_require__(23875); +const stripFinalNewline = __nccwpck_require__(50077); +const npmRunPath = __nccwpck_require__(79391); +const onetime = __nccwpck_require__(81053); +const makeError = __nccwpck_require__(35528); +const normalizeStdio = __nccwpck_require__(89816); +const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __nccwpck_require__(51134); +const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __nccwpck_require__(15156); +const {mergePromise, getSpawnedPromise} = __nccwpck_require__(31045); +const {joinCommand, parseCommand} = __nccwpck_require__(36429); -/***/ }), +const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; -/***/ 12097: -/***/ ((module, exports, __webpack_require__) => { +const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { + const env = extendEnv ? {...process.env, ...envOption} : envOption; -"use strict"; + if (preferLocal) { + return npmRunPath.env({env, cwd: localDir, execPath}); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tls_1 = __webpack_require__(4016); -const deferToConnect = (socket, fn) => { - let listeners; - if (typeof fn === 'function') { - const connect = fn; - listeners = { connect }; - } - else { - listeners = fn; - } - const hasConnectListener = typeof listeners.connect === 'function'; - const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; - const hasCloseListener = typeof listeners.close === 'function'; - const onConnect = () => { - if (hasConnectListener) { - listeners.connect(); - } - if (socket instanceof tls_1.TLSSocket && hasSecureConnectListener) { - if (socket.authorized) { - listeners.secureConnect(); - } - else if (!socket.authorizationError) { - socket.once('secureConnect', listeners.secureConnect); - } - } - if (hasCloseListener) { - socket.once('close', listeners.close); - } - }; - if (socket.writable && !socket.connecting) { - onConnect(); - } - else if (socket.connecting) { - socket.once('connect', onConnect); - } - else if (socket.destroyed && hasCloseListener) { - listeners.close(socket._hadError); - } + return env; }; -exports.default = deferToConnect; -// For CommonJS default export support -module.exports = deferToConnect; -module.exports.default = deferToConnect; +const handleArguments = (file, args, options = {}) => { + const parsed = crossSpawn._parse(file, args, options); + file = parsed.command; + args = parsed.args; + options = parsed.options; -/***/ }), - -/***/ 47778: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; + options = { + maxBuffer: DEFAULT_MAX_BUFFER, + buffer: true, + stripFinalNewline: true, + extendEnv: true, + preferLocal: false, + localDir: options.cwd || process.cwd(), + execPath: process.execPath, + encoding: 'utf8', + reject: true, + cleanup: true, + all: false, + windowsHide: true, + ...options + }; + options.env = getEnv(options); -var keys = __webpack_require__(28777); -var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + options.stdio = normalizeStdio(options); -var toStr = Object.prototype.toString; -var concat = Array.prototype.concat; -var origDefineProperty = Object.defineProperty; + if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { + // #116 + args.unshift('/q'); + } -var isFunction = function (fn) { - return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; + return {file, args, options, parsed}; }; -var arePropertyDescriptorsSupported = function () { - var obj = {}; - try { - origDefineProperty(obj, 'x', { enumerable: false, value: obj }); - // eslint-disable-next-line no-unused-vars, no-restricted-syntax - for (var _ in obj) { // jscs:ignore disallowUnusedVariables - return false; - } - return obj.x === obj; - } catch (e) { /* this is IE 8. */ - return false; +const handleOutput = (options, value, error) => { + if (typeof value !== 'string' && !Buffer.isBuffer(value)) { + // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` + return error === undefined ? undefined : ''; } -}; -var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); -var defineProperty = function (object, name, value, predicate) { - if (name in object && (!isFunction(predicate) || !predicate())) { - return; - } - if (supportsDescriptors) { - origDefineProperty(object, name, { - configurable: true, - enumerable: false, - value: value, - writable: true - }); - } else { - object[name] = value; + if (options.stripFinalNewline) { + return stripFinalNewline(value); } -}; -var defineProperties = function (object, map) { - var predicates = arguments.length > 2 ? arguments[2] : {}; - var props = keys(map); - if (hasSymbols) { - props = concat.call(props, Object.getOwnPropertySymbols(map)); - } - for (var i = 0; i < props.length; i += 1) { - defineProperty(object, props[i], map[props[i]], predicates[props[i]]); - } + return value; }; -defineProperties.supportsDescriptors = !!supportsDescriptors; - -module.exports = defineProperties; - +const execa = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); -/***/ }), + let spawned; + try { + spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); + } catch (error) { + // Ensure the returned error is always both a promise and a child process + const dummySpawned = new childProcess.ChildProcess(); + const errorPromise = Promise.reject(makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + parsed, + timedOut: false, + isCanceled: false, + killed: false + })); + return mergePromise(dummySpawned, errorPromise); + } -/***/ 3402: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + const spawnedPromise = getSpawnedPromise(spawned); + const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); + const processDone = setExitHandler(spawned, parsed.options, timedPromise); -"use strict"; -/*! - * detect-file - * - * Copyright (c) 2016-2017, Brian Woodward. - * Released under the MIT License. - */ + const context = {isCanceled: false}; + spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); + spawned.cancel = spawnedCancel.bind(null, spawned, context); + const handlePromise = async () => { + const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); + const stdout = handleOutput(parsed.options, stdoutResult); + const stderr = handleOutput(parsed.options, stderrResult); + const all = handleOutput(parsed.options, allResult); -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); - -/** - * Detect the given `filepath` if it exists. - * - * ```js - * var res = detect('package.json'); - * console.log(res); - * //=> "package.json" - * - * var res = detect('fake-file.json'); - * console.log(res) - * //=> null - * ``` - * - * @param {String} `filepath` filepath to detect. - * @param {Object} `options` Additional options. - * @param {Boolean} `options.nocase` Set this to `true` to force case-insensitive filename checks. This is useful on case sensitive file systems. - * @return {String} Returns the detected filepath if it exists, otherwise returns `null`. - * @api public - */ - -module.exports = function detect(filepath, options) { - if (!filepath || (typeof filepath !== 'string')) { - return null; - } - if (fs.existsSync(filepath)) { - return path.resolve(filepath); - } - - options = options || {}; - if (options.nocase === true) { - return nocase(filepath); - } - return null; -}; - -/** - * Check if the filepath exists by falling back to reading in the entire directory. - * Returns the real filepath (for case sensitive file systems) if found. - * - * @param {String} `filepath` filepath to check. - * @return {String} Returns found filepath if exists, otherwise null. - */ - -function nocase(filepath) { - filepath = path.resolve(filepath); - var res = tryReaddir(filepath); - if (res === null) { - return null; - } + if (error || exitCode !== 0 || signal !== null) { + const returnedError = makeError({ + error, + exitCode, + signal, + stdout, + stderr, + all, + command, + parsed, + timedOut, + isCanceled: context.isCanceled, + killed: spawned.killed + }); - // "filepath" is a directory, an error would be - // thrown if it doesn't exist. if we're here, it exists - if (res.path === filepath) { - return res.path; - } + if (!parsed.options.reject) { + return returnedError; + } - // "filepath" is not a directory - // compare against upper case later - // see https://nodejs.org/en/docs/guides/working-with-different-filesystems/ - var upper = filepath.toUpperCase(); - var len = res.files.length; - var idx = -1; + throw returnedError; + } - while (++idx < len) { - var fp = path.resolve(res.path, res.files[idx]); - if (filepath === fp || upper === fp) { - return fp; - } - var fpUpper = fp.toUpperCase(); - if (filepath === fpUpper || upper === fpUpper) { - return fp; - } - } + return { + command, + exitCode: 0, + stdout, + stderr, + all, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; + }; - return null; -} + const handlePromiseOnce = onetime(handlePromise); -/** - * Try to read the filepath as a directory first, then fallback to the filepath's dirname. - * - * @param {String} `filepath` path of the directory to read. - * @return {Object} Object containing `path` and `files` if succesful. Otherwise, null. - */ + handleInput(spawned, parsed.options.input); -function tryReaddir(filepath) { - var ctx = { path: filepath, files: [] }; - try { - ctx.files = fs.readdirSync(filepath); - return ctx; - } catch (err) {} - try { - ctx.path = path.dirname(filepath); - ctx.files = fs.readdirSync(ctx.path); - return ctx; - } catch (err) {} - return null; -} + spawned.all = makeAllStream(spawned, parsed.options); + return mergePromise(spawned, handlePromiseOnce); +}; -/***/ }), +module.exports = execa; -/***/ 7192: -/***/ ((module) => { +module.exports.sync = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); -// Only Node.JS has a process variable that is of [[Class]] process -module.exports = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; + validateInputSync(parsed.options); + let result; + try { + result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); + } catch (error) { + throw makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + parsed, + timedOut: false, + isCanceled: false, + killed: false + }); + } -/***/ }), + const stdout = handleOutput(parsed.options, result.stdout, result.error); + const stderr = handleOutput(parsed.options, result.stderr, result.error); -/***/ 71257: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (result.error || result.status !== 0 || result.signal !== null) { + const error = makeError({ + stdout, + stderr, + error: result.error, + signal: result.signal, + exitCode: result.status, + command, + parsed, + timedOut: result.error && result.error.code === 'ETIMEDOUT', + isCanceled: false, + killed: result.signal !== null + }); -"use strict"; + if (!parsed.options.reject) { + return error; + } + throw error; + } -var stream = __webpack_require__(92413); + return { + command, + exitCode: 0, + stdout, + stderr, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; +}; -function DuplexWrapper(options, writable, readable) { - if (typeof readable === "undefined") { - readable = writable; - writable = options; - options = null; - } +module.exports.command = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa(file, args, options); +}; - stream.Duplex.call(this, options); +module.exports.commandSync = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa.sync(file, args, options); +}; - if (typeof readable.read !== "function") { - readable = (new stream.Readable(options)).wrap(readable); - } +module.exports.node = (scriptPath, args, options = {}) => { + if (args && !Array.isArray(args) && typeof args === 'object') { + options = args; + args = []; + } - this._writable = writable; - this._readable = readable; - this._waiting = false; + const stdio = normalizeStdio.node(options); + const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect')); - var self = this; + const { + nodePath = process.execPath, + nodeOptions = defaultExecArgv + } = options; - writable.once("finish", function() { - self.end(); - }); + return execa( + nodePath, + [ + ...nodeOptions, + scriptPath, + ...(Array.isArray(args) ? args : []) + ], + { + ...options, + stdin: undefined, + stdout: undefined, + stderr: undefined, + stdio, + shell: false + } + ); +}; - this.once("finish", function() { - writable.end(); - }); - readable.on("readable", function() { - if (self._waiting) { - self._waiting = false; - self._read(); - } - }); +/***/ }), - readable.once("end", function() { - self.push(null); - }); +/***/ 36429: +/***/ ((module) => { - if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { - writable.on("error", function(err) { - self.emit("error", err); - }); +"use strict"; - readable.on("error", function(err) { - self.emit("error", err); - }); - } -} +const SPACES_REGEXP = / +/g; -DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); +const joinCommand = (file, args = []) => { + if (!Array.isArray(args)) { + return file; + } -DuplexWrapper.prototype._write = function _write(input, encoding, done) { - this._writable.write(input, encoding, done); + return [file, ...args].join(' '); }; -DuplexWrapper.prototype._read = function _read() { - var buf; - var reads = 0; - while ((buf = this._readable.read()) !== null) { - this.push(buf); - reads++; - } - if (reads === 0) { - this._waiting = true; - } -}; +// Handle `execa.command()` +const parseCommand = command => { + const tokens = []; + for (const token of command.trim().split(SPACES_REGEXP)) { + // Allow spaces to be escaped by a backslash if not meant as a delimiter + const previousToken = tokens[tokens.length - 1]; + if (previousToken && previousToken.endsWith('\\')) { + // Merge previous token with current one + tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; + } else { + tokens.push(token); + } + } -module.exports = function duplex2(options, writable, readable) { - return new DuplexWrapper(options, writable, readable); + return tokens; }; -module.exports.DuplexWrapper = DuplexWrapper; +module.exports = { + joinCommand, + parseCommand +}; /***/ }), -/***/ 33874: -/***/ ((module) => { +/***/ 35528: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/*! - * encodeurl - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ +const {signalsByName} = __nccwpck_require__(18694); +const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { + if (timedOut) { + return `timed out after ${timeout} milliseconds`; + } -/** - * Module exports. - * @public - */ + if (isCanceled) { + return 'was canceled'; + } -module.exports = encodeUrl + if (errorCode !== undefined) { + return `failed with ${errorCode}`; + } -/** - * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") - * and including invalid escape sequences. - * @private - */ + if (signal !== undefined) { + return `was killed with ${signal} (${signalDescription})`; + } -var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + if (exitCode !== undefined) { + return `failed with exit code ${exitCode}`; + } -/** - * RegExp to match unmatched surrogate pair. - * @private - */ + return 'failed'; +}; -var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g +const makeError = ({ + stdout, + stderr, + all, + error, + signal, + exitCode, + command, + timedOut, + isCanceled, + killed, + parsed: {options: {timeout}} +}) => { + // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. + // We normalize them to `undefined` + exitCode = exitCode === null ? undefined : exitCode; + signal = signal === null ? undefined : signal; + const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; -/** - * String to replace unmatched surrogate pair with. - * @private - */ + const errorCode = error && error.code; -var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); + const execaMessage = `Command ${prefix}: ${command}`; + const isError = Object.prototype.toString.call(error) === '[object Error]'; + const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; + const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); -/** - * Encode a URL to a percent-encoded form, excluding already-encoded sequences. - * - * This function will take an already-encoded URL and encode all the non-URL - * code points. This function will not encode the "%" character unless it is - * not part of a valid sequence (`%20` will be left as-is, but `%foo` will - * be encoded as `%25foo`). - * - * This encode is meant to be "safe" and does not throw errors. It will try as - * hard as it can to properly encode the given URL, including replacing any raw, - * unpaired surrogate pairs with the Unicode replacement character prior to - * encoding. - * - * @param {string} url - * @return {string} - * @public - */ + if (isError) { + error.originalMessage = error.message; + error.message = message; + } else { + error = new Error(message); + } -function encodeUrl (url) { - return String(url) - .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) - .replace(ENCODE_CHARS_REGEXP, encodeURI) -} + error.shortMessage = shortMessage; + error.command = command; + error.exitCode = exitCode; + error.signal = signal; + error.signalDescription = signalDescription; + error.stdout = stdout; + error.stderr = stderr; + if (all !== undefined) { + error.all = all; + } -/***/ }), + if ('bufferedData' in error) { + delete error.bufferedData; + } -/***/ 85100: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + error.failed = true; + error.timedOut = Boolean(timedOut); + error.isCanceled = isCanceled; + error.killed = killed && !timedOut; -"use strict"; + return error; +}; +module.exports = makeError; -var iconvLite = __webpack_require__(24959); -// Expose to the world -module.exports.O = convert; +/***/ }), -/** - * Convert encoding of an UTF-8 string or a buffer - * - * @param {String|Buffer} str String to be converted - * @param {String} to Encoding to be converted to - * @param {String} [from='UTF-8'] Encoding to be converted from - * @return {Buffer} Encoded string - */ -function convert(str, to, from) { - from = checkEncoding(from || 'UTF-8'); - to = checkEncoding(to || 'UTF-8'); - str = str || ''; +/***/ 51134: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var result; +"use strict"; - if (from !== 'UTF-8' && typeof str === 'string') { - str = Buffer.from(str, 'binary'); - } +const os = __nccwpck_require__(12087); +const onExit = __nccwpck_require__(22317); - if (from === to) { - if (typeof str === 'string') { - result = Buffer.from(str); - } else { - result = str; - } - } else { - try { - result = convertIconvLite(str, to, from); - } catch (E) { - console.error(E); - result = str; - } - } +const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; - if (typeof result === 'string') { - result = Buffer.from(result, 'utf-8'); - } +// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior +const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { + const killResult = kill(signal); + setKillTimeout(kill, signal, options, killResult); + return killResult; +}; - return result; -} +const setKillTimeout = (kill, signal, options, killResult) => { + if (!shouldForceKill(signal, options, killResult)) { + return; + } -/** - * Convert encoding of astring with iconv-lite - * - * @param {String|Buffer} str String to be converted - * @param {String} to Encoding to be converted to - * @param {String} [from='UTF-8'] Encoding to be converted from - * @return {Buffer} Encoded string - */ -function convertIconvLite(str, to, from) { - if (to === 'UTF-8') { - return iconvLite.decode(str, from); - } else if (from === 'UTF-8') { - return iconvLite.encode(str, to); - } else { - return iconvLite.encode(iconvLite.decode(str, from), to); - } -} + const timeout = getForceKillAfterTimeout(options); + const t = setTimeout(() => { + kill('SIGKILL'); + }, timeout); -/** - * Converts charset name if needed - * - * @param {String} name Character set - * @return {String} Character set name - */ -function checkEncoding(name) { - return (name || '') - .toString() - .trim() - .replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1') - .replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1') - .replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1') - .replace(/^ks_c_5601\-1987$/i, 'CP949') - .replace(/^us[\-_]?ascii$/i, 'ASCII') - .toUpperCase(); -} + // Guarded because there's no `.unref()` when `execa` is used in the renderer + // process in Electron. This cannot be tested since we don't run tests in + // Electron. + // istanbul ignore else + if (t.unref) { + t.unref(); + } +}; +const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { + return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; +}; -/***/ }), +const isSigterm = signal => { + return signal === os.constants.signals.SIGTERM || + (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); +}; -/***/ 32773: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { + if (forceKillAfterTimeout === true) { + return DEFAULT_FORCE_KILL_TIMEOUT; + } -"use strict"; + if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { + throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); + } -var Buffer = __webpack_require__(52340).Buffer; + return forceKillAfterTimeout; +}; -// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. -// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. -// To save memory and loading time, we read table files only when requested. +// `childProcess.cancel()` +const spawnedCancel = (spawned, context) => { + const killResult = spawned.kill(); -exports._dbcs = DBCSCodec; + if (killResult) { + context.isCanceled = true; + } +}; -var UNASSIGNED = -1, - GB18030_CODE = -2, - SEQ_START = -10, - NODE_START = -1000, - UNASSIGNED_NODE = new Array(0x100), - DEF_CHAR = -1; +const timeoutKill = (spawned, signal, reject) => { + spawned.kill(signal); + reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); +}; -for (var i = 0; i < 0x100; i++) - UNASSIGNED_NODE[i] = UNASSIGNED; +// `timeout` option handling +const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { + if (timeout === 0 || timeout === undefined) { + return spawnedPromise; + } + if (!Number.isFinite(timeout) || timeout < 0) { + throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); + } -// Class DBCSCodec reads and initializes mapping tables. -function DBCSCodec(codecOptions, iconv) { - this.encodingName = codecOptions.encodingName; - if (!codecOptions) - throw new Error("DBCS codec is called without the data.") - if (!codecOptions.table) - throw new Error("Encoding '" + this.encodingName + "' has no data."); + let timeoutId; + const timeoutPromise = new Promise((resolve, reject) => { + timeoutId = setTimeout(() => { + timeoutKill(spawned, killSignal, reject); + }, timeout); + }); - // Load tables. - var mappingTable = codecOptions.table(); + const safeSpawnedPromise = spawnedPromise.finally(() => { + clearTimeout(timeoutId); + }); + return Promise.race([timeoutPromise, safeSpawnedPromise]); +}; - // Decode tables: MBCS -> Unicode. +// `cleanup` option handling +const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { + if (!cleanup || detached) { + return timedPromise; + } - // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. - // Trie root is decodeTables[0]. - // Values: >= 0 -> unicode character code. can be > 0xFFFF - // == UNASSIGNED -> unknown/unassigned sequence. - // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. - // <= NODE_START -> index of the next node in our trie to process next byte. - // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. - this.decodeTables = []; - this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. + const removeExitHandler = onExit(() => { + spawned.kill(); + }); - // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. - this.decodeTableSeq = []; + return timedPromise.finally(() => { + removeExitHandler(); + }); +}; - // Actual mapping tables consist of chunks. Use them to fill up decode tables. - for (var i = 0; i < mappingTable.length; i++) - this._addDecodeChunk(mappingTable[i]); +module.exports = { + spawnedKill, + spawnedCancel, + setupTimeout, + setExitHandler +}; - // Load & create GB18030 tables when needed. - if (typeof codecOptions.gb18030 === 'function') { - this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. - // Add GB18030 common decode nodes. - var commonThirdByteNodeIdx = this.decodeTables.length; - this.decodeTables.push(UNASSIGNED_NODE.slice(0)); +/***/ }), - var commonFourthByteNodeIdx = this.decodeTables.length; - this.decodeTables.push(UNASSIGNED_NODE.slice(0)); +/***/ 31045: +/***/ ((module) => { - // Fill out the tree - var firstByteNode = this.decodeTables[0]; - for (var i = 0x81; i <= 0xFE; i++) { - var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; - for (var j = 0x30; j <= 0x39; j++) { - if (secondByteNode[j] === UNASSIGNED) { - secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; - } else if (secondByteNode[j] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 2"); - } +"use strict"; - var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; - for (var k = 0x81; k <= 0xFE; k++) { - if (thirdByteNode[k] === UNASSIGNED) { - thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; - } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { - continue; - } else if (thirdByteNode[k] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 3"); - } - var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; - for (var l = 0x30; l <= 0x39; l++) { - if (fourthByteNode[l] === UNASSIGNED) - fourthByteNode[l] = GB18030_CODE; - } - } - } - } - } +const nativePromisePrototype = (async () => {})().constructor.prototype; +const descriptors = ['then', 'catch', 'finally'].map(property => [ + property, + Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) +]); - this.defaultCharUnicode = iconv.defaultCharUnicode; +// The return value is a mixin of `childProcess` and `Promise` +const mergePromise = (spawned, promise) => { + for (const [property, descriptor] of descriptors) { + // Starting the main `promise` is deferred to avoid consuming streams + const value = typeof promise === 'function' ? + (...args) => Reflect.apply(descriptor.value, promise(), args) : + descriptor.value.bind(promise); - - // Encode tables: Unicode -> DBCS. + Reflect.defineProperty(spawned, property, {...descriptor, value}); + } - // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. - // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. - // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). - // == UNASSIGNED -> no conversion found. Output a default char. - // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. - this.encodeTable = []; - - // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of - // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key - // means end of sequence (needed when one sequence is a strict subsequence of another). - // Objects are kept separately from encodeTable to increase performance. - this.encodeTableSeq = []; + return spawned; +}; - // Some chars can be decoded, but need not be encoded. - var skipEncodeChars = {}; - if (codecOptions.encodeSkipVals) - for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { - var val = codecOptions.encodeSkipVals[i]; - if (typeof val === 'number') - skipEncodeChars[val] = true; - else - for (var j = val.from; j <= val.to; j++) - skipEncodeChars[j] = true; - } - - // Use decode trie to recursively fill out encode tables. - this._fillEncodeTable(0, 0, skipEncodeChars); +// Use promises instead of `child_process` events +const getSpawnedPromise = spawned => { + return new Promise((resolve, reject) => { + spawned.on('exit', (exitCode, signal) => { + resolve({exitCode, signal}); + }); - // Add more encoding pairs when needed. - if (codecOptions.encodeAdd) { - for (var uChar in codecOptions.encodeAdd) - if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) - this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); - } + spawned.on('error', error => { + reject(error); + }); - this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; - if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; - if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); -} + if (spawned.stdin) { + spawned.stdin.on('error', error => { + reject(error); + }); + } + }); +}; -DBCSCodec.prototype.encoder = DBCSEncoder; -DBCSCodec.prototype.decoder = DBCSDecoder; +module.exports = { + mergePromise, + getSpawnedPromise +}; -// Decoder helpers -DBCSCodec.prototype._getDecodeTrieNode = function(addr) { - var bytes = []; - for (; addr > 0; addr >>>= 8) - bytes.push(addr & 0xFF); - if (bytes.length == 0) - bytes.push(0); - var node = this.decodeTables[0]; - for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. - var val = node[bytes[i]]; - if (val == UNASSIGNED) { // Create new node. - node[bytes[i]] = NODE_START - this.decodeTables.length; - this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); - } - else if (val <= NODE_START) { // Existing node. - node = this.decodeTables[NODE_START - val]; - } - else - throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); - } - return node; -} +/***/ }), +/***/ 89816: +/***/ ((module) => { -DBCSCodec.prototype._addDecodeChunk = function(chunk) { - // First element of chunk is the hex mbcs code where we start. - var curAddr = parseInt(chunk[0], 16); +"use strict"; - // Choose the decoding node where we'll write our chars. - var writeTable = this._getDecodeTrieNode(curAddr); - curAddr = curAddr & 0xFF; +const aliases = ['stdin', 'stdout', 'stderr']; - // Write all other elements of the chunk to the table. - for (var k = 1; k < chunk.length; k++) { - var part = chunk[k]; - if (typeof part === "string") { // String, write as-is. - for (var l = 0; l < part.length;) { - var code = part.charCodeAt(l++); - if (0xD800 <= code && code < 0xDC00) { // Decode surrogate - var codeTrail = part.charCodeAt(l++); - if (0xDC00 <= codeTrail && codeTrail < 0xE000) - writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); - else - throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); - } - else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) - var len = 0xFFF - code + 2; - var seq = []; - for (var m = 0; m < len; m++) - seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. +const hasAlias = options => aliases.some(alias => options[alias] !== undefined); - writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; - this.decodeTableSeq.push(seq); - } - else - writeTable[curAddr++] = code; // Basic char - } - } - else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. - var charCode = writeTable[curAddr - 1] + 1; - for (var l = 0; l < part; l++) - writeTable[curAddr++] = charCode++; - } - else - throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); - } - if (curAddr > 0xFF) - throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); -} +const normalizeStdio = options => { + if (!options) { + return; + } -// Encoder helpers -DBCSCodec.prototype._getEncodeBucket = function(uCode) { - var high = uCode >> 8; // This could be > 0xFF because of astral characters. - if (this.encodeTable[high] === undefined) - this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. - return this.encodeTable[high]; -} + const {stdio} = options; -DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { - var bucket = this._getEncodeBucket(uCode); - var low = uCode & 0xFF; - if (bucket[low] <= SEQ_START) - this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. - else if (bucket[low] == UNASSIGNED) - bucket[low] = dbcsCode; -} + if (stdio === undefined) { + return aliases.map(alias => options[alias]); + } -DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { - - // Get the root of character tree according to first character of the sequence. - var uCode = seq[0]; - var bucket = this._getEncodeBucket(uCode); - var low = uCode & 0xFF; + if (hasAlias(options)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); + } - var node; - if (bucket[low] <= SEQ_START) { - // There's already a sequence with - use it. - node = this.encodeTableSeq[SEQ_START-bucket[low]]; - } - else { - // There was no sequence object - allocate a new one. - node = {}; - if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. - bucket[low] = SEQ_START - this.encodeTableSeq.length; - this.encodeTableSeq.push(node); - } + if (typeof stdio === 'string') { + return stdio; + } - // Traverse the character tree, allocating new nodes as needed. - for (var j = 1; j < seq.length-1; j++) { - var oldVal = node[uCode]; - if (typeof oldVal === 'object') - node = oldVal; - else { - node = node[uCode] = {} - if (oldVal !== undefined) - node[DEF_CHAR] = oldVal - } - } + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } - // Set the leaf to given dbcsCode. - uCode = seq[seq.length-1]; - node[uCode] = dbcsCode; -} + const length = Math.max(stdio.length, aliases.length); + return Array.from({length}, (value, index) => stdio[index]); +}; -DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { - var node = this.decodeTables[nodeIdx]; - var hasValues = false; - var subNodeEmpty = {}; - for (var i = 0; i < 0x100; i++) { - var uCode = node[i]; - var mbCode = prefix + i; - if (skipEncodeChars[mbCode]) - continue; +module.exports = normalizeStdio; - if (uCode >= 0) { - this._setEncodeChar(uCode, mbCode); - hasValues = true; - } else if (uCode <= NODE_START) { - var subNodeIdx = NODE_START - uCode; - if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). - var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. - if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) - hasValues = true; - else - subNodeEmpty[subNodeIdx] = true; - } - } else if (uCode <= SEQ_START) { - this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); - hasValues = true; - } - } - return hasValues; -} +// `ipc` is pushed unless it is already present +module.exports.node = options => { + const stdio = normalizeStdio(options); + if (stdio === 'ipc') { + return 'ipc'; + } + if (stdio === undefined || typeof stdio === 'string') { + return [stdio, stdio, stdio, 'ipc']; + } -// == Encoder ================================================================== + if (stdio.includes('ipc')) { + return stdio; + } -function DBCSEncoder(options, codec) { - // Encoder state - this.leadSurrogate = -1; - this.seqObj = undefined; - - // Static data - this.encodeTable = codec.encodeTable; - this.encodeTableSeq = codec.encodeTableSeq; - this.defaultCharSingleByte = codec.defCharSB; - this.gb18030 = codec.gb18030; -} + return [...stdio, 'ipc']; +}; -DBCSEncoder.prototype.write = function(str) { - var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), - leadSurrogate = this.leadSurrogate, - seqObj = this.seqObj, nextChar = -1, - i = 0, j = 0; - while (true) { - // 0. Get next character. - if (nextChar === -1) { - if (i == str.length) break; - var uCode = str.charCodeAt(i++); - } - else { - var uCode = nextChar; - nextChar = -1; - } +/***/ }), - // 1. Handle surrogates. - if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. - if (uCode < 0xDC00) { // We've got lead surrogate. - if (leadSurrogate === -1) { - leadSurrogate = uCode; - continue; - } else { - leadSurrogate = uCode; - // Double lead surrogate found. - uCode = UNASSIGNED; - } - } else { // We've got trail surrogate. - if (leadSurrogate !== -1) { - uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); - leadSurrogate = -1; - } else { - // Incomplete surrogate pair - only trail surrogate found. - uCode = UNASSIGNED; - } - - } - } - else if (leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. - leadSurrogate = -1; - } +/***/ 15156: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 2. Convert uCode character. - var dbcsCode = UNASSIGNED; - if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence - var resCode = seqObj[uCode]; - if (typeof resCode === 'object') { // Sequence continues. - seqObj = resCode; - continue; +"use strict"; - } else if (typeof resCode == 'number') { // Sequence finished. Write it. - dbcsCode = resCode; +const isStream = __nccwpck_require__(93458); +const getStream = __nccwpck_require__(14961); +const mergeStream = __nccwpck_require__(6020); - } else if (resCode == undefined) { // Current character is not part of the sequence. +// `input` option +const handleInput = (spawned, input) => { + // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 + // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 + if (input === undefined || spawned.stdin === undefined) { + return; + } - // Try default character for this sequence - resCode = seqObj[DEF_CHAR]; - if (resCode !== undefined) { - dbcsCode = resCode; // Found. Write it. - nextChar = uCode; // Current character will be written too in the next iteration. + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +}; - } else { - // TODO: What if we have no default? (resCode == undefined) - // Then, we should write first char of the sequence as-is and try the rest recursively. - // Didn't do it for now because no encoding has this situation yet. - // Currently, just skip the sequence and write current char. - } - } - seqObj = undefined; - } - else if (uCode >= 0) { // Regular character - var subtable = this.encodeTable[uCode >> 8]; - if (subtable !== undefined) - dbcsCode = subtable[uCode & 0xFF]; - - if (dbcsCode <= SEQ_START) { // Sequence start - seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; - continue; - } +// `all` interleaves `stdout` and `stderr` +const makeAllStream = (spawned, {all}) => { + if (!all || (!spawned.stdout && !spawned.stderr)) { + return; + } - if (dbcsCode == UNASSIGNED && this.gb18030) { - // Use GB18030 algorithm to find character(s) to write. - var idx = findIdx(this.gb18030.uChars, uCode); - if (idx != -1) { - var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; - newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; - newBuf[j++] = 0x30 + dbcsCode; - continue; - } - } - } + const mixed = mergeStream(); - // 3. Write dbcsCode character. - if (dbcsCode === UNASSIGNED) - dbcsCode = this.defaultCharSingleByte; - - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode; - } - else if (dbcsCode < 0x10000) { - newBuf[j++] = dbcsCode >> 8; // high byte - newBuf[j++] = dbcsCode & 0xFF; // low byte - } - else if (dbcsCode < 0x1000000) { - newBuf[j++] = dbcsCode >> 16; - newBuf[j++] = (dbcsCode >> 8) & 0xFF; - newBuf[j++] = dbcsCode & 0xFF; - } else { - newBuf[j++] = dbcsCode >>> 24; - newBuf[j++] = (dbcsCode >>> 16) & 0xFF; - newBuf[j++] = (dbcsCode >>> 8) & 0xFF; - newBuf[j++] = dbcsCode & 0xFF; - } - } + if (spawned.stdout) { + mixed.add(spawned.stdout); + } - this.seqObj = seqObj; - this.leadSurrogate = leadSurrogate; - return newBuf.slice(0, j); -} + if (spawned.stderr) { + mixed.add(spawned.stderr); + } -DBCSEncoder.prototype.end = function() { - if (this.leadSurrogate === -1 && this.seqObj === undefined) - return; // All clean. Most often case. + return mixed; +}; - var newBuf = Buffer.alloc(10), j = 0; +// On failure, `result.stdout|stderr|all` should contain the currently buffered stream +const getBufferedData = async (stream, streamPromise) => { + if (!stream) { + return; + } - if (this.seqObj) { // We're in the sequence. - var dbcsCode = this.seqObj[DEF_CHAR]; - if (dbcsCode !== undefined) { // Write beginning of the sequence. - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode; - } - else { - newBuf[j++] = dbcsCode >> 8; // high byte - newBuf[j++] = dbcsCode & 0xFF; // low byte - } - } else { - // See todo above. - } - this.seqObj = undefined; - } + stream.destroy(); - if (this.leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - newBuf[j++] = this.defaultCharSingleByte; - this.leadSurrogate = -1; - } - - return newBuf.slice(0, j); -} + try { + return await streamPromise; + } catch (error) { + return error.bufferedData; + } +}; -// Export for testing -DBCSEncoder.prototype.findIdx = findIdx; +const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { + if (!stream || !buffer) { + return; + } + if (encoding) { + return getStream(stream, {encoding, maxBuffer}); + } -// == Decoder ================================================================== + return getStream.buffer(stream, {maxBuffer}); +}; -function DBCSDecoder(options, codec) { - // Decoder state - this.nodeIdx = 0; - this.prevBytes = []; +// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) +const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { + const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); + const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); + const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); - // Static data - this.decodeTables = codec.decodeTables; - this.decodeTableSeq = codec.decodeTableSeq; - this.defaultCharUnicode = codec.defaultCharUnicode; - this.gb18030 = codec.gb18030; -} + try { + return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); + } catch (error) { + return Promise.all([ + {error, signal: error.signal, timedOut: error.timedOut}, + getBufferedData(stdout, stdoutPromise), + getBufferedData(stderr, stderrPromise), + getBufferedData(all, allPromise) + ]); + } +}; -DBCSDecoder.prototype.write = function(buf) { - var newBuf = Buffer.alloc(buf.length*2), - nodeIdx = this.nodeIdx, - prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, - seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. - uCode; +const validateInputSync = ({input}) => { + if (isStream(input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } +}; - for (var i = 0, j = 0; i < buf.length; i++) { - var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; +module.exports = { + handleInput, + makeAllStream, + getSpawnedResult, + validateInputSync +}; - // Lookup in current trie node. - var uCode = this.decodeTables[nodeIdx][curByte]; - if (uCode >= 0) { - // Normal character, just use it. - } - else if (uCode === UNASSIGNED) { // Unknown char. - // TODO: Callback with seq. - uCode = this.defaultCharUnicode.charCodeAt(0); - i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. - } - else if (uCode === GB18030_CODE) { - if (i >= 3) { - var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); - } else { - var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + - (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + - (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + - (curByte-0x30); - } - var idx = findIdx(this.gb18030.gbChars, ptr); - uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; - } - else if (uCode <= NODE_START) { // Go to next trie node. - nodeIdx = NODE_START - uCode; - continue; - } - else if (uCode <= SEQ_START) { // Output a sequence of chars. - var seq = this.decodeTableSeq[SEQ_START - uCode]; - for (var k = 0; k < seq.length - 1; k++) { - uCode = seq[k]; - newBuf[j++] = uCode & 0xFF; - newBuf[j++] = uCode >> 8; - } - uCode = seq[seq.length-1]; - } - else - throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); - // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode >= 0x10000) { - uCode -= 0x10000; - var uCodeLead = 0xD800 | (uCode >> 10); - newBuf[j++] = uCodeLead & 0xFF; - newBuf[j++] = uCodeLead >> 8; +/***/ }), - uCode = 0xDC00 | (uCode & 0x3FF); - } - newBuf[j++] = uCode & 0xFF; - newBuf[j++] = uCode >> 8; +/***/ 10828: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Reset trie node. - nodeIdx = 0; seqStart = i+1; - } +"use strict"; - this.nodeIdx = nodeIdx; - this.prevBytes = (seqStart >= 0) - ? Array.prototype.slice.call(buf, seqStart) - : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); +const {PassThrough: PassThroughStream} = __nccwpck_require__(92413); - return newBuf.slice(0, j).toString('ucs2'); -} +module.exports = options => { + options = {...options}; -DBCSDecoder.prototype.end = function() { - var ret = ''; + const {array} = options; + let {encoding} = options; + const isBuffer = encoding === 'buffer'; + let objectMode = false; - // Try to parse all remaining chars. - while (this.prevBytes.length > 0) { - // Skip 1 character in the buffer. - ret += this.defaultCharUnicode; - var bytesArr = this.prevBytes.slice(1); + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || 'utf8'; + } - // Parse remaining as usual. - this.prevBytes = []; - this.nodeIdx = 0; - if (bytesArr.length > 0) - ret += this.write(bytesArr); - } + if (isBuffer) { + encoding = null; + } - this.prevBytes = []; - this.nodeIdx = 0; - return ret; -} + const stream = new PassThroughStream({objectMode}); -// Binary search for GB18030. Returns largest i such that table[i] <= val. -function findIdx(table, val) { - if (table[0] > val) - return -1; + if (encoding) { + stream.setEncoding(encoding); + } - var l = 0, r = table.length; - while (l < r-1) { // always table[l] <= val < table[r] - var mid = l + ((r-l+1) >> 1); - if (table[mid] <= val) - l = mid; - else - r = mid; - } - return l; -} + let length = 0; + const chunks = []; + stream.on('data', chunk => { + chunks.push(chunk); + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); -/***/ }), + stream.getBufferedValue = () => { + if (array) { + return chunks; + } -/***/ 62241: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); + }; -"use strict"; + stream.getBufferedLength = () => length; + return stream; +}; -// Description of supported double byte encodings and aliases. -// Tables are not require()-d until they are needed to speed up library load. -// require()-s are direct to support Browserify. -module.exports = { - - // == Japanese/ShiftJIS ==================================================== - // All japanese encodings are based on JIS X set of standards: - // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. - // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. - // Has several variations in 1978, 1983, 1990 and 1997. - // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. - // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. - // 2 planes, first is superset of 0208, second - revised 0212. - // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) +/***/ }), - // Byte encodings are: - // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte - // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. - // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. - // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. - // 0x00-0x7F - lower part of 0201 - // 0x8E, 0xA1-0xDF - upper part of 0201 - // (0xA1-0xFE)x2 - 0208 plane (94x94). - // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). - // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. - // Used as-is in ISO2022 family. - // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, - // 0201-1976 Roman, 0208-1978, 0208-1983. - // * ISO2022-JP-1: Adds esc seq for 0212-1990. - // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. - // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. - // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. - // - // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. - // - // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html +/***/ 14961: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - 'shiftjis': { - type: '_dbcs', - table: function() { return __webpack_require__(24438) }, - encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, - encodeSkipVals: [{from: 0xED40, to: 0xF940}], - }, - 'csshiftjis': 'shiftjis', - 'mskanji': 'shiftjis', - 'sjis': 'shiftjis', - 'windows31j': 'shiftjis', - 'ms31j': 'shiftjis', - 'xsjis': 'shiftjis', - 'windows932': 'shiftjis', - 'ms932': 'shiftjis', - '932': 'shiftjis', - 'cp932': 'shiftjis', +"use strict"; - 'eucjp': { - type: '_dbcs', - table: function() { return __webpack_require__(34674) }, - encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, - }, +const {constants: BufferConstants} = __nccwpck_require__(64293); +const stream = __nccwpck_require__(92413); +const {promisify} = __nccwpck_require__(31669); +const bufferStream = __nccwpck_require__(10828); - // TODO: KDDI extension to Shift_JIS - // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. - // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. +const streamPipelinePromisified = promisify(stream.pipeline); +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} - // == Chinese/GBK ========================================================== - // http://en.wikipedia.org/wiki/GBK - // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder +async function getStream(inputStream, options) { + if (!inputStream) { + throw new Error('Expected a stream'); + } - // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 - 'gb2312': 'cp936', - 'gb231280': 'cp936', - 'gb23121980': 'cp936', - 'csgb2312': 'cp936', - 'csiso58gb231280': 'cp936', - 'euccn': 'cp936', + options = { + maxBuffer: Infinity, + ...options + }; - // Microsoft's CP936 is a subset and approximation of GBK. - 'windows936': 'cp936', - 'ms936': 'cp936', - '936': 'cp936', - 'cp936': { - type: '_dbcs', - table: function() { return __webpack_require__(13768) }, - }, + const {maxBuffer} = options; + const stream = bufferStream(options); - // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. - 'gbk': { - type: '_dbcs', - table: function() { return __webpack_require__(13768).concat(__webpack_require__(19416)) }, - }, - 'xgbk': 'gbk', - 'isoir58': 'gbk', + await new Promise((resolve, reject) => { + const rejectPromise = error => { + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error.bufferedData = stream.getBufferedValue(); + } - // GB18030 is an algorithmic extension of GBK. - // Main source: https://www.w3.org/TR/encoding/#gbk-encoder - // http://icu-project.org/docs/papers/gb18030.html - // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml - // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 - 'gb18030': { - type: '_dbcs', - table: function() { return __webpack_require__(13768).concat(__webpack_require__(19416)) }, - gb18030: function() { return __webpack_require__(80139) }, - encodeSkipVals: [0x80], - encodeAdd: {'€': 0xA2E3}, - }, + reject(error); + }; - 'chinese': 'gb18030', + (async () => { + try { + await streamPipelinePromisified(inputStream, stream); + resolve(); + } catch (error) { + rejectPromise(error); + } + })(); + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); - // == Korean =============================================================== - // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. - 'windows949': 'cp949', - 'ms949': 'cp949', - '949': 'cp949', - 'cp949': { - type: '_dbcs', - table: function() { return __webpack_require__(67726) }, - }, + return stream.getBufferedValue(); +} - 'cseuckr': 'cp949', - 'csksc56011987': 'cp949', - 'euckr': 'cp949', - 'isoir149': 'cp949', - 'korean': 'cp949', - 'ksc56011987': 'cp949', - 'ksc56011989': 'cp949', - 'ksc5601': 'cp949', +module.exports = getStream; +module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); +module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); +module.exports.MaxBufferError = MaxBufferError; - // == Big5/Taiwan/Hong Kong ================================================ - // There are lots of tables for Big5 and cp950. Please see the following links for history: - // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html - // Variations, in roughly number of defined chars: - // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT - // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ - // * Big5-2003 (Taiwan standard) almost superset of cp950. - // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. - // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. - // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. - // Plus, it has 4 combining sequences. - // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 - // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. - // Implementations are not consistent within browsers; sometimes labeled as just big5. - // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. - // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 - // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. - // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt - // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt - // - // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder - // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. +/***/ }), - 'windows950': 'cp950', - 'ms950': 'cp950', - '950': 'cp950', - 'cp950': { - type: '_dbcs', - table: function() { return __webpack_require__(47428) }, - }, +/***/ 2933: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. - 'big5': 'big5hkscs', - 'big5hkscs': { - type: '_dbcs', - table: function() { return __webpack_require__(47428).concat(__webpack_require__(50354)) }, - encodeSkipVals: [0xa2cc], - }, +const debug = __nccwpck_require__(30787)('extract-zip') +// eslint-disable-next-line node/no-unsupported-features/node-builtins +const { createWriteStream, promises: fs } = __nccwpck_require__(35747) +const getStream = __nccwpck_require__(63886) +const path = __nccwpck_require__(85622) +const { promisify } = __nccwpck_require__(31669) +const stream = __nccwpck_require__(92413) +const yauzl = __nccwpck_require__(8245) - 'cnbig5': 'big5hkscs', - 'csbig5': 'big5hkscs', - 'xxbig5': 'big5hkscs', -}; +const openZip = promisify(yauzl.open) +const pipeline = promisify(stream.pipeline) +class Extractor { + constructor (zipPath, opts) { + this.zipPath = zipPath + this.opts = opts + } -/***/ }), + async extract () { + debug('opening', this.zipPath, 'with opts', this.opts) -/***/ 15761: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + this.zipfile = await openZip(this.zipPath, { lazyEntries: true }) + this.canceled = false -"use strict"; + return new Promise((resolve, reject) => { + this.zipfile.on('error', err => { + this.canceled = true + reject(err) + }) + this.zipfile.readEntry() + this.zipfile.on('close', () => { + if (!this.canceled) { + debug('zip extraction complete') + resolve() + } + }) -// Update this array if you add/rename/remove files in this directory. -// We support Browserify by skipping automatic module discovery and requiring modules directly. -var modules = [ - __webpack_require__(64644), - __webpack_require__(66042), - __webpack_require__(56918), - __webpack_require__(43769), - __webpack_require__(95379), - __webpack_require__(80002), - __webpack_require__(92746), - __webpack_require__(32773), - __webpack_require__(62241), -]; + this.zipfile.on('entry', async entry => { + /* istanbul ignore if */ + if (this.canceled) { + debug('skipping entry', entry.fileName, { cancelled: this.canceled }) + return + } -// Put all encoding/alias/codec definitions to single object and export it. -for (var i = 0; i < modules.length; i++) { - var module = modules[i]; - for (var enc in module) - if (Object.prototype.hasOwnProperty.call(module, enc)) - exports[enc] = module[enc]; -} + debug('zipfile entry', entry.fileName) + if (entry.fileName.startsWith('__MACOSX/')) { + this.zipfile.readEntry() + return + } -/***/ }), + const destDir = path.dirname(path.join(this.opts.dir, entry.fileName)) -/***/ 64644: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + try { + await fs.mkdir(destDir, { recursive: true }) -"use strict"; + const canonicalDestDir = await fs.realpath(destDir) + const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir) -var Buffer = __webpack_require__(52340).Buffer; + if (relativeDestDir.split(path.sep).includes('..')) { + throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`) + } -// Export Node.js internal encodings. + await this.extractEntry(entry) + debug('finished processing', entry.fileName) + this.zipfile.readEntry() + } catch (err) { + this.canceled = true + this.zipfile.close() + reject(err) + } + }) + }) + } -module.exports = { - // Encodings - utf8: { type: "_internal", bomAware: true}, - cesu8: { type: "_internal", bomAware: true}, - unicode11utf8: "utf8", + async extractEntry (entry) { + /* istanbul ignore if */ + if (this.canceled) { + debug('skipping entry extraction', entry.fileName, { cancelled: this.canceled }) + return + } - ucs2: { type: "_internal", bomAware: true}, - utf16le: "ucs2", + if (this.opts.onEntry) { + this.opts.onEntry(entry, this.zipfile) + } - binary: { type: "_internal" }, - base64: { type: "_internal" }, - hex: { type: "_internal" }, + const dest = path.join(this.opts.dir, entry.fileName) - // Codec. - _internal: InternalCodec, -}; + // convert external file attr int into a fs stat mode int + const mode = (entry.externalFileAttributes >> 16) & 0xFFFF + // check if it's a symlink or dir (using stat mode constants) + const IFMT = 61440 + const IFDIR = 16384 + const IFLNK = 40960 + const symlink = (mode & IFMT) === IFLNK + let isDir = (mode & IFMT) === IFDIR -//------------------------------------------------------------------------------ + // Failsafe, borrowed from jsZip + if (!isDir && entry.fileName.endsWith('/')) { + isDir = true + } -function InternalCodec(codecOptions, iconv) { - this.enc = codecOptions.encodingName; - this.bomAware = codecOptions.bomAware; + // check for windows weird way of specifying a directory + // https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566 + const madeBy = entry.versionMadeBy >> 8 + if (!isDir) isDir = (madeBy === 0 && entry.externalFileAttributes === 16) - if (this.enc === "base64") - this.encoder = InternalEncoderBase64; - else if (this.enc === "cesu8") { - this.enc = "utf8"; // Use utf8 for decoding. - this.encoder = InternalEncoderCesu8; + debug('extracting entry', { filename: entry.fileName, isDir: isDir, isSymlink: symlink }) - // Add decoder for versions of Node not supporting CESU-8 - if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { - this.decoder = InternalDecoderCesu8; - this.defaultCharUnicode = iconv.defaultCharUnicode; - } - } -} + const procMode = this.getExtractedMode(mode, isDir) & 0o777 -InternalCodec.prototype.encoder = InternalEncoder; -InternalCodec.prototype.decoder = InternalDecoder; + // always ensure folders are created + const destDir = isDir ? dest : path.dirname(dest) -//------------------------------------------------------------------------------ + const mkdirOptions = { recursive: true } + if (isDir) { + mkdirOptions.mode = procMode + } + debug('mkdir', { dir: destDir, ...mkdirOptions }) + await fs.mkdir(destDir, mkdirOptions) + if (isDir) return -// We use node.js internal decoder. Its signature is the same as ours. -var StringDecoder = __webpack_require__(24304).StringDecoder; + debug('opening read stream', dest) + const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry) -if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. - StringDecoder.prototype.end = function() {}; + if (symlink) { + const link = await getStream(readStream) + debug('creating symlink', link, dest) + await fs.symlink(link, dest) + } else { + await pipeline(readStream, createWriteStream(dest, { mode: procMode })) + } + } + getExtractedMode (entryMode, isDir) { + let mode = entryMode + // Set defaults, if necessary + if (mode === 0) { + if (isDir) { + if (this.opts.defaultDirMode) { + mode = parseInt(this.opts.defaultDirMode, 10) + } -function InternalDecoder(options, codec) { - this.decoder = new StringDecoder(codec.enc); -} + if (!mode) { + mode = 0o755 + } + } else { + if (this.opts.defaultFileMode) { + mode = parseInt(this.opts.defaultFileMode, 10) + } -InternalDecoder.prototype.write = function(buf) { - if (!Buffer.isBuffer(buf)) { - buf = Buffer.from(buf); + if (!mode) { + mode = 0o644 + } + } } - return this.decoder.write(buf); -} - -InternalDecoder.prototype.end = function() { - return this.decoder.end(); + return mode + } } +module.exports = async function (zipPath, opts) { + debug('creating target directory', opts.dir) -//------------------------------------------------------------------------------ -// Encoder is mostly trivial - -function InternalEncoder(options, codec) { - this.enc = codec.enc; -} + if (!path.isAbsolute(opts.dir)) { + throw new Error('Target directory is expected to be absolute') + } -InternalEncoder.prototype.write = function(str) { - return Buffer.from(str, this.enc); + await fs.mkdir(opts.dir, { recursive: true }) + opts.dir = await fs.realpath(opts.dir) + return new Extractor(zipPath, opts).extract() } -InternalEncoder.prototype.end = function() { -} +/***/ }), -//------------------------------------------------------------------------------ -// Except base64 encoder, which must keep its state. +/***/ 92104: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function InternalEncoderBase64(options, codec) { - this.prevStr = ''; -} +var fs = __nccwpck_require__(35747); +var util = __nccwpck_require__(31669); +var stream = __nccwpck_require__(92413); +var Readable = stream.Readable; +var Writable = stream.Writable; +var PassThrough = stream.PassThrough; +var Pend = __nccwpck_require__(71932); +var EventEmitter = __nccwpck_require__(28614).EventEmitter; -InternalEncoderBase64.prototype.write = function(str) { - str = this.prevStr + str; - var completeQuads = str.length - (str.length % 4); - this.prevStr = str.slice(completeQuads); - str = str.slice(0, completeQuads); +exports.createFromBuffer = createFromBuffer; +exports.createFromFd = createFromFd; +exports.BufferSlicer = BufferSlicer; +exports.FdSlicer = FdSlicer; - return Buffer.from(str, "base64"); -} +util.inherits(FdSlicer, EventEmitter); +function FdSlicer(fd, options) { + options = options || {}; + EventEmitter.call(this); -InternalEncoderBase64.prototype.end = function() { - return Buffer.from(this.prevStr, "base64"); + this.fd = fd; + this.pend = new Pend(); + this.pend.max = 1; + this.refCount = 0; + this.autoClose = !!options.autoClose; } +FdSlicer.prototype.read = function(buffer, offset, length, position, callback) { + var self = this; + self.pend.go(function(cb) { + fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) { + cb(); + callback(err, bytesRead, buffer); + }); + }); +}; -//------------------------------------------------------------------------------ -// CESU-8 encoder is also special. +FdSlicer.prototype.write = function(buffer, offset, length, position, callback) { + var self = this; + self.pend.go(function(cb) { + fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) { + cb(); + callback(err, written, buffer); + }); + }); +}; -function InternalEncoderCesu8(options, codec) { -} +FdSlicer.prototype.createReadStream = function(options) { + return new ReadStream(this, options); +}; -InternalEncoderCesu8.prototype.write = function(str) { - var buf = Buffer.alloc(str.length * 3), bufIdx = 0; - for (var i = 0; i < str.length; i++) { - var charCode = str.charCodeAt(i); - // Naive implementation, but it works because CESU-8 is especially easy - // to convert from UTF-16 (which all JS strings are encoded in). - if (charCode < 0x80) - buf[bufIdx++] = charCode; - else if (charCode < 0x800) { - buf[bufIdx++] = 0xC0 + (charCode >>> 6); - buf[bufIdx++] = 0x80 + (charCode & 0x3f); - } - else { // charCode will always be < 0x10000 in javascript. - buf[bufIdx++] = 0xE0 + (charCode >>> 12); - buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); - buf[bufIdx++] = 0x80 + (charCode & 0x3f); - } - } - return buf.slice(0, bufIdx); -} +FdSlicer.prototype.createWriteStream = function(options) { + return new WriteStream(this, options); +}; -InternalEncoderCesu8.prototype.end = function() { -} +FdSlicer.prototype.ref = function() { + this.refCount += 1; +}; -//------------------------------------------------------------------------------ -// CESU-8 decoder is not implemented in Node v4.0+ +FdSlicer.prototype.unref = function() { + var self = this; + self.refCount -= 1; -function InternalDecoderCesu8(options, codec) { - this.acc = 0; - this.contBytes = 0; - this.accBytes = 0; - this.defaultCharUnicode = codec.defaultCharUnicode; -} + if (self.refCount > 0) return; + if (self.refCount < 0) throw new Error("invalid unref"); -InternalDecoderCesu8.prototype.write = function(buf) { - var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, - res = ''; - for (var i = 0; i < buf.length; i++) { - var curByte = buf[i]; - if ((curByte & 0xC0) !== 0x80) { // Leading byte - if (contBytes > 0) { // Previous code is invalid - res += this.defaultCharUnicode; - contBytes = 0; - } + if (self.autoClose) { + fs.close(self.fd, onCloseDone); + } - if (curByte < 0x80) { // Single-byte code - res += String.fromCharCode(curByte); - } else if (curByte < 0xE0) { // Two-byte code - acc = curByte & 0x1F; - contBytes = 1; accBytes = 1; - } else if (curByte < 0xF0) { // Three-byte code - acc = curByte & 0x0F; - contBytes = 2; accBytes = 1; - } else { // Four or more are not supported for CESU-8. - res += this.defaultCharUnicode; - } - } else { // Continuation byte - if (contBytes > 0) { // We're waiting for it. - acc = (acc << 6) | (curByte & 0x3f); - contBytes--; accBytes++; - if (contBytes === 0) { - // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) - if (accBytes === 2 && acc < 0x80 && acc > 0) - res += this.defaultCharUnicode; - else if (accBytes === 3 && acc < 0x800) - res += this.defaultCharUnicode; - else - // Actually add character. - res += String.fromCharCode(acc); - } - } else { // Unexpected continuation byte - res += this.defaultCharUnicode; - } - } + function onCloseDone(err) { + if (err) { + self.emit('error', err); + } else { + self.emit('close'); } - this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; - return res; -} - -InternalDecoderCesu8.prototype.end = function() { - var res = 0; - if (this.contBytes > 0) - res += this.defaultCharUnicode; - return res; -} + } +}; +util.inherits(ReadStream, Readable); +function ReadStream(context, options) { + options = options || {}; + Readable.call(this, options); -/***/ }), + this.context = context; + this.context.ref(); -/***/ 95379: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + this.start = options.start || 0; + this.endOffset = options.end; + this.pos = this.start; + this.destroyed = false; +} -"use strict"; +ReadStream.prototype._read = function(n) { + var self = this; + if (self.destroyed) return; -var Buffer = __webpack_require__(52340).Buffer; + var toRead = Math.min(self._readableState.highWaterMark, n); + if (self.endOffset != null) { + toRead = Math.min(toRead, self.endOffset - self.pos); + } + if (toRead <= 0) { + self.destroyed = true; + self.push(null); + self.context.unref(); + return; + } + self.context.pend.go(function(cb) { + if (self.destroyed) return cb(); + var buffer = new Buffer(toRead); + fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) { + if (err) { + self.destroy(err); + } else if (bytesRead === 0) { + self.destroyed = true; + self.push(null); + self.context.unref(); + } else { + self.pos += bytesRead; + self.push(buffer.slice(0, bytesRead)); + } + cb(); + }); + }); +}; -// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that -// correspond to encoded bytes (if 128 - then lower half is ASCII). +ReadStream.prototype.destroy = function(err) { + if (this.destroyed) return; + err = err || new Error("stream destroyed"); + this.destroyed = true; + this.emit('error', err); + this.context.unref(); +}; -exports._sbcs = SBCSCodec; -function SBCSCodec(codecOptions, iconv) { - if (!codecOptions) - throw new Error("SBCS codec is called without the data.") - - // Prepare char buffer for decoding. - if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) - throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); - - if (codecOptions.chars.length === 128) { - var asciiString = ""; - for (var i = 0; i < 128; i++) - asciiString += String.fromCharCode(i); - codecOptions.chars = asciiString + codecOptions.chars; - } +util.inherits(WriteStream, Writable); +function WriteStream(context, options) { + options = options || {}; + Writable.call(this, options); - this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); - - // Encoding buffer. - var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); + this.context = context; + this.context.ref(); - for (var i = 0; i < codecOptions.chars.length; i++) - encodeBuf[codecOptions.chars.charCodeAt(i)] = i; + this.start = options.start || 0; + this.endOffset = (options.end == null) ? Infinity : +options.end; + this.bytesWritten = 0; + this.pos = this.start; + this.destroyed = false; - this.encodeBuf = encodeBuf; + this.on('finish', this.destroy.bind(this)); } -SBCSCodec.prototype.encoder = SBCSEncoder; -SBCSCodec.prototype.decoder = SBCSDecoder; +WriteStream.prototype._write = function(buffer, encoding, callback) { + var self = this; + if (self.destroyed) return; + if (self.pos + buffer.length > self.endOffset) { + var err = new Error("maximum file length exceeded"); + err.code = 'ETOOBIG'; + self.destroy(); + callback(err); + return; + } + self.context.pend.go(function(cb) { + if (self.destroyed) return cb(); + fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) { + if (err) { + self.destroy(); + cb(); + callback(err); + } else { + self.bytesWritten += bytes; + self.pos += bytes; + self.emit('progress'); + cb(); + callback(); + } + }); + }); +}; -function SBCSEncoder(options, codec) { - this.encodeBuf = codec.encodeBuf; -} +WriteStream.prototype.destroy = function() { + if (this.destroyed) return; + this.destroyed = true; + this.context.unref(); +}; -SBCSEncoder.prototype.write = function(str) { - var buf = Buffer.alloc(str.length); - for (var i = 0; i < str.length; i++) - buf[i] = this.encodeBuf[str.charCodeAt(i)]; - - return buf; -} +util.inherits(BufferSlicer, EventEmitter); +function BufferSlicer(buffer, options) { + EventEmitter.call(this); -SBCSEncoder.prototype.end = function() { + options = options || {}; + this.refCount = 0; + this.buffer = buffer; + this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER; } +BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) { + var end = position + length; + var delta = end - this.buffer.length; + var written = (delta > 0) ? delta : length; + this.buffer.copy(buffer, offset, position, end); + setImmediate(function() { + callback(null, written); + }); +}; -function SBCSDecoder(options, codec) { - this.decodeBuf = codec.decodeBuf; -} +BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) { + buffer.copy(this.buffer, position, offset, offset + length); + setImmediate(function() { + callback(null, length, buffer); + }); +}; -SBCSDecoder.prototype.write = function(buf) { - // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. - var decodeBuf = this.decodeBuf; - var newBuf = Buffer.alloc(buf.length*2); - var idx1 = 0, idx2 = 0; - for (var i = 0; i < buf.length; i++) { - idx1 = buf[i]*2; idx2 = i*2; - newBuf[idx2] = decodeBuf[idx1]; - newBuf[idx2+1] = decodeBuf[idx1+1]; +BufferSlicer.prototype.createReadStream = function(options) { + options = options || {}; + var readStream = new PassThrough(options); + readStream.destroyed = false; + readStream.start = options.start || 0; + readStream.endOffset = options.end; + // by the time this function returns, we'll be done. + readStream.pos = readStream.endOffset || this.buffer.length; + + // respect the maxChunkSize option to slice up the chunk into smaller pieces. + var entireSlice = this.buffer.slice(readStream.start, readStream.pos); + var offset = 0; + while (true) { + var nextOffset = offset + this.maxChunkSize; + if (nextOffset >= entireSlice.length) { + // last chunk + if (offset < entireSlice.length) { + readStream.write(entireSlice.slice(offset, entireSlice.length)); + } + break; } - return newBuf.toString('ucs2'); + readStream.write(entireSlice.slice(offset, nextOffset)); + offset = nextOffset; + } + + readStream.end(); + readStream.destroy = function() { + readStream.destroyed = true; + }; + return readStream; +}; + +BufferSlicer.prototype.createWriteStream = function(options) { + var bufferSlicer = this; + options = options || {}; + var writeStream = new Writable(options); + writeStream.start = options.start || 0; + writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end; + writeStream.bytesWritten = 0; + writeStream.pos = writeStream.start; + writeStream.destroyed = false; + writeStream._write = function(buffer, encoding, callback) { + if (writeStream.destroyed) return; + + var end = writeStream.pos + buffer.length; + if (end > writeStream.endOffset) { + var err = new Error("maximum file length exceeded"); + err.code = 'ETOOBIG'; + writeStream.destroyed = true; + callback(err); + return; + } + buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length); + + writeStream.bytesWritten += buffer.length; + writeStream.pos = end; + writeStream.emit('progress'); + callback(); + }; + writeStream.destroy = function() { + writeStream.destroyed = true; + }; + return writeStream; +}; + +BufferSlicer.prototype.ref = function() { + this.refCount += 1; +}; + +BufferSlicer.prototype.unref = function() { + this.refCount -= 1; + + if (this.refCount < 0) { + throw new Error("invalid unref"); + } +}; + +function createFromBuffer(buffer, options) { + return new BufferSlicer(buffer, options); } -SBCSDecoder.prototype.end = function() { +function createFromFd(fd, options) { + return new FdSlicer(fd, options); } /***/ }), -/***/ 92746: -/***/ ((module) => { +/***/ 2885: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +const path = __nccwpck_require__(85622); +const locatePath = __nccwpck_require__(30815); +const pathExists = __nccwpck_require__(89255); -// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. -module.exports = { - "437": "cp437", - "737": "cp737", - "775": "cp775", - "850": "cp850", - "852": "cp852", - "855": "cp855", - "856": "cp856", - "857": "cp857", - "858": "cp858", - "860": "cp860", - "861": "cp861", - "862": "cp862", - "863": "cp863", - "864": "cp864", - "865": "cp865", - "866": "cp866", - "869": "cp869", - "874": "windows874", - "922": "cp922", - "1046": "cp1046", - "1124": "cp1124", - "1125": "cp1125", - "1129": "cp1129", - "1133": "cp1133", - "1161": "cp1161", - "1162": "cp1162", - "1163": "cp1163", - "1250": "windows1250", - "1251": "windows1251", - "1252": "windows1252", - "1253": "windows1253", - "1254": "windows1254", - "1255": "windows1255", - "1256": "windows1256", - "1257": "windows1257", - "1258": "windows1258", - "28591": "iso88591", - "28592": "iso88592", - "28593": "iso88593", - "28594": "iso88594", - "28595": "iso88595", - "28596": "iso88596", - "28597": "iso88597", - "28598": "iso88598", - "28599": "iso88599", - "28600": "iso885910", - "28601": "iso885911", - "28603": "iso885913", - "28604": "iso885914", - "28605": "iso885915", - "28606": "iso885916", - "windows874": { - "type": "_sbcs", - "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "win874": "windows874", - "cp874": "windows874", - "windows1250": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "win1250": "windows1250", - "cp1250": "windows1250", - "windows1251": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "win1251": "windows1251", - "cp1251": "windows1251", - "windows1252": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "win1252": "windows1252", - "cp1252": "windows1252", - "windows1253": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "win1253": "windows1253", - "cp1253": "windows1253", - "windows1254": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "win1254": "windows1254", - "cp1254": "windows1254", - "windows1255": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "win1255": "windows1255", - "cp1255": "windows1255", - "windows1256": { - "type": "_sbcs", - "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" - }, - "win1256": "windows1256", - "cp1256": "windows1256", - "windows1257": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" - }, - "win1257": "windows1257", - "cp1257": "windows1257", - "windows1258": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "win1258": "windows1258", - "cp1258": "windows1258", - "iso88591": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28591": "iso88591", - "iso88592": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "cp28592": "iso88592", - "iso88593": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" - }, - "cp28593": "iso88593", - "iso88594": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" - }, - "cp28594": "iso88594", - "iso88595": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" - }, - "cp28595": "iso88595", - "iso88596": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" - }, - "cp28596": "iso88596", - "iso88597": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "cp28597": "iso88597", - "iso88598": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "cp28598": "iso88598", - "iso88599": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "cp28599": "iso88599", - "iso885910": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" - }, - "cp28600": "iso885910", - "iso885911": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "cp28601": "iso885911", - "iso885913": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" - }, - "cp28603": "iso885913", - "iso885914": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" - }, - "cp28604": "iso885914", - "iso885915": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28605": "iso885915", - "iso885916": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" - }, - "cp28606": "iso885916", - "cp437": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm437": "cp437", - "csibm437": "cp437", - "cp737": { - "type": "_sbcs", - "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " - }, - "ibm737": "cp737", - "csibm737": "cp737", - "cp775": { - "type": "_sbcs", - "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " - }, - "ibm775": "cp775", - "csibm775": "cp775", - "cp850": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm850": "cp850", - "csibm850": "cp850", - "cp852": { - "type": "_sbcs", - "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " - }, - "ibm852": "cp852", - "csibm852": "cp852", - "cp855": { - "type": "_sbcs", - "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " - }, - "ibm855": "cp855", - "csibm855": "cp855", - "cp856": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm856": "cp856", - "csibm856": "cp856", - "cp857": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " - }, - "ibm857": "cp857", - "csibm857": "cp857", - "cp858": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm858": "cp858", - "csibm858": "cp858", - "cp860": { - "type": "_sbcs", - "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm860": "cp860", - "csibm860": "cp860", - "cp861": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm861": "cp861", - "csibm861": "cp861", - "cp862": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm862": "cp862", - "csibm862": "cp862", - "cp863": { - "type": "_sbcs", - "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm863": "cp863", - "csibm863": "cp863", - "cp864": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" - }, - "ibm864": "cp864", - "csibm864": "cp864", - "cp865": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm865": "cp865", - "csibm865": "cp865", - "cp866": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " - }, - "ibm866": "cp866", - "csibm866": "cp866", - "cp869": { - "type": "_sbcs", - "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " - }, - "ibm869": "cp869", - "csibm869": "cp869", - "cp922": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" - }, - "ibm922": "cp922", - "csibm922": "cp922", - "cp1046": { - "type": "_sbcs", - "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" - }, - "ibm1046": "cp1046", - "csibm1046": "cp1046", - "cp1124": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" - }, - "ibm1124": "cp1124", - "csibm1124": "cp1124", - "cp1125": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " - }, - "ibm1125": "cp1125", - "csibm1125": "cp1125", - "cp1129": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1129": "cp1129", - "csibm1129": "cp1129", - "cp1133": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" - }, - "ibm1133": "cp1133", - "csibm1133": "cp1133", - "cp1161": { - "type": "_sbcs", - "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " - }, - "ibm1161": "cp1161", - "csibm1161": "cp1161", - "cp1162": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "ibm1162": "cp1162", - "csibm1162": "cp1162", - "cp1163": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1163": "cp1163", - "csibm1163": "cp1163", - "maccroatian": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" - }, - "maccyrillic": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "macgreek": { - "type": "_sbcs", - "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" - }, - "maciceland": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macroman": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macromania": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macthai": { - "type": "_sbcs", - "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" - }, - "macturkish": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macukraine": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "koi8r": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8u": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8ru": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8t": { - "type": "_sbcs", - "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "armscii8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" - }, - "rk1048": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "tcvn": { - "type": "_sbcs", - "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" - }, - "georgianacademy": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "georgianps": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "pt154": { - "type": "_sbcs", - "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "viscii": { - "type": "_sbcs", - "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" - }, - "iso646cn": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "iso646jp": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "hproman8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" - }, - "macintosh": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "ascii": { - "type": "_sbcs", - "chars": "��������������������������������������������������������������������������������������������������������������������������������" - }, - "tis620": { - "type": "_sbcs", - "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - } -} - -/***/ }), - -/***/ 80002: -/***/ ((module) => { - -"use strict"; - - -// Manually added data to be used by sbcs codec in addition to generated one. - -module.exports = { - // Not supported by iconv, not sure why. - "10029": "maccenteuro", - "maccenteuro": { - "type": "_sbcs", - "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" - }, - - "808": "cp808", - "ibm808": "cp808", - "cp808": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " - }, - - "mik": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - - "cp720": { - "type": "_sbcs", - "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" - }, - - // Aliases of generated encodings. - "ascii8bit": "ascii", - "usascii": "ascii", - "ansix34": "ascii", - "ansix341968": "ascii", - "ansix341986": "ascii", - "csascii": "ascii", - "cp367": "ascii", - "ibm367": "ascii", - "isoir6": "ascii", - "iso646us": "ascii", - "iso646irv": "ascii", - "us": "ascii", - - "latin1": "iso88591", - "latin2": "iso88592", - "latin3": "iso88593", - "latin4": "iso88594", - "latin5": "iso88599", - "latin6": "iso885910", - "latin7": "iso885913", - "latin8": "iso885914", - "latin9": "iso885915", - "latin10": "iso885916", - - "csisolatin1": "iso88591", - "csisolatin2": "iso88592", - "csisolatin3": "iso88593", - "csisolatin4": "iso88594", - "csisolatincyrillic": "iso88595", - "csisolatinarabic": "iso88596", - "csisolatingreek" : "iso88597", - "csisolatinhebrew": "iso88598", - "csisolatin5": "iso88599", - "csisolatin6": "iso885910", - - "l1": "iso88591", - "l2": "iso88592", - "l3": "iso88593", - "l4": "iso88594", - "l5": "iso88599", - "l6": "iso885910", - "l7": "iso885913", - "l8": "iso885914", - "l9": "iso885915", - "l10": "iso885916", - - "isoir14": "iso646jp", - "isoir57": "iso646cn", - "isoir100": "iso88591", - "isoir101": "iso88592", - "isoir109": "iso88593", - "isoir110": "iso88594", - "isoir144": "iso88595", - "isoir127": "iso88596", - "isoir126": "iso88597", - "isoir138": "iso88598", - "isoir148": "iso88599", - "isoir157": "iso885910", - "isoir166": "tis620", - "isoir179": "iso885913", - "isoir199": "iso885914", - "isoir203": "iso885915", - "isoir226": "iso885916", - - "cp819": "iso88591", - "ibm819": "iso88591", - - "cyrillic": "iso88595", - - "arabic": "iso88596", - "arabic8": "iso88596", - "ecma114": "iso88596", - "asmo708": "iso88596", - - "greek" : "iso88597", - "greek8" : "iso88597", - "ecma118" : "iso88597", - "elot928" : "iso88597", - - "hebrew": "iso88598", - "hebrew8": "iso88598", - - "turkish": "iso88599", - "turkish8": "iso88599", - - "thai": "iso885911", - "thai8": "iso885911", - - "celtic": "iso885914", - "celtic8": "iso885914", - "isoceltic": "iso885914", - - "tis6200": "tis620", - "tis62025291": "tis620", - "tis62025330": "tis620", - - "10000": "macroman", - "10006": "macgreek", - "10007": "maccyrillic", - "10079": "maciceland", - "10081": "macturkish", - - "cspc8codepage437": "cp437", - "cspc775baltic": "cp775", - "cspc850multilingual": "cp850", - "cspcp852": "cp852", - "cspc862latinhebrew": "cp862", - "cpgr": "cp869", - - "msee": "cp1250", - "mscyrl": "cp1251", - "msansi": "cp1252", - "msgreek": "cp1253", - "msturk": "cp1254", - "mshebr": "cp1255", - "msarab": "cp1256", - "winbaltrim": "cp1257", - - "cp20866": "koi8r", - "20866": "koi8r", - "ibm878": "koi8r", - "cskoi8r": "koi8r", - - "cp21866": "koi8u", - "21866": "koi8u", - "ibm1168": "koi8u", - - "strk10482002": "rk1048", - - "tcvn5712": "tcvn", - "tcvn57121": "tcvn", - - "gb198880": "iso646cn", - "cn": "iso646cn", - - "csiso14jisc6220ro": "iso646jp", - "jisc62201969ro": "iso646jp", - "jp": "iso646jp", - - "cshproman8": "hproman8", - "r8": "hproman8", - "roman8": "hproman8", - "xroman8": "hproman8", - "ibm1051": "hproman8", - - "mac": "macintosh", - "csmacintosh": "macintosh", -}; - - - -/***/ }), - -/***/ 56918: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var Buffer = __webpack_require__(52340).Buffer; - -// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js - -// == UTF16-BE codec. ========================================================== - -exports.utf16be = Utf16BECodec; -function Utf16BECodec() { -} - -Utf16BECodec.prototype.encoder = Utf16BEEncoder; -Utf16BECodec.prototype.decoder = Utf16BEDecoder; -Utf16BECodec.prototype.bomAware = true; - - -// -- Encoding - -function Utf16BEEncoder() { -} - -Utf16BEEncoder.prototype.write = function(str) { - var buf = Buffer.from(str, 'ucs2'); - for (var i = 0; i < buf.length; i += 2) { - var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; - } - return buf; -} - -Utf16BEEncoder.prototype.end = function() { -} - - -// -- Decoding - -function Utf16BEDecoder() { - this.overflowByte = -1; -} - -Utf16BEDecoder.prototype.write = function(buf) { - if (buf.length == 0) - return ''; - - var buf2 = Buffer.alloc(buf.length + 1), - i = 0, j = 0; - - if (this.overflowByte !== -1) { - buf2[0] = buf[0]; - buf2[1] = this.overflowByte; - i = 1; j = 2; - } - - for (; i < buf.length-1; i += 2, j+= 2) { - buf2[j] = buf[i+1]; - buf2[j+1] = buf[i]; - } - - this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; - - return buf2.slice(0, j).toString('ucs2'); -} - -Utf16BEDecoder.prototype.end = function() { - this.overflowByte = -1; -} - - -// == UTF-16 codec ============================================================= -// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. -// Defaults to UTF-16LE, as it's prevalent and default in Node. -// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le -// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); - -// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). - -exports.utf16 = Utf16Codec; -function Utf16Codec(codecOptions, iconv) { - this.iconv = iconv; -} - -Utf16Codec.prototype.encoder = Utf16Encoder; -Utf16Codec.prototype.decoder = Utf16Decoder; - - -// -- Encoding (pass-through) - -function Utf16Encoder(options, codec) { - options = options || {}; - if (options.addBOM === undefined) - options.addBOM = true; - this.encoder = codec.iconv.getEncoder('utf-16le', options); -} - -Utf16Encoder.prototype.write = function(str) { - return this.encoder.write(str); -} - -Utf16Encoder.prototype.end = function() { - return this.encoder.end(); -} - - -// -- Decoding - -function Utf16Decoder(options, codec) { - this.decoder = null; - this.initialBufs = []; - this.initialBufsLen = 0; - - this.options = options || {}; - this.iconv = codec.iconv; -} - -Utf16Decoder.prototype.write = function(buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf); - this.initialBufsLen += buf.length; - - if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) - return ''; - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.write(buf); -} - -Utf16Decoder.prototype.end = function() { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - var trail = this.decoder.end(); - if (trail) - resStr += trail; - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - return this.decoder.end(); -} - -function detectEncoding(bufs, defaultEncoding) { - var b = []; - var charsProcessed = 0; - var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. - - outer_loop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i]; - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]); - if (b.length === 2) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; - if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; - } - - if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; - if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; - - b.length = 0; - charsProcessed++; - - if (charsProcessed >= 100) { - break outer_loop; - } - } - } - } - - // Make decisions. - // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. - // So, we count ASCII as if it was LE or BE, and decide from that. - if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; - if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || 'utf-16le'; -} - - - - -/***/ }), - -/***/ 66042: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -var Buffer = __webpack_require__(52340).Buffer; - -// == UTF32-LE/BE codec. ========================================================== - -exports._utf32 = Utf32Codec; - -function Utf32Codec(codecOptions, iconv) { - this.iconv = iconv; - this.bomAware = true; - this.isLE = codecOptions.isLE; -} - -exports.utf32le = { type: '_utf32', isLE: true }; -exports.utf32be = { type: '_utf32', isLE: false }; - -// Aliases -exports.ucs4le = 'utf32le'; -exports.ucs4be = 'utf32be'; - -Utf32Codec.prototype.encoder = Utf32Encoder; -Utf32Codec.prototype.decoder = Utf32Decoder; - -// -- Encoding - -function Utf32Encoder(options, codec) { - this.isLE = codec.isLE; - this.highSurrogate = 0; -} - -Utf32Encoder.prototype.write = function(str) { - var src = Buffer.from(str, 'ucs2'); - var dst = Buffer.alloc(src.length * 2); - var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; - var offset = 0; - - for (var i = 0; i < src.length; i += 2) { - var code = src.readUInt16LE(i); - var isHighSurrogate = (0xD800 <= code && code < 0xDC00); - var isLowSurrogate = (0xDC00 <= code && code < 0xE000); - - if (this.highSurrogate) { - if (isHighSurrogate || !isLowSurrogate) { - // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low - // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character - // (technically wrong, but expected by some applications, like Windows file names). - write32.call(dst, this.highSurrogate, offset); - offset += 4; - } - else { - // Create 32-bit value from high and low surrogates; - var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; - - write32.call(dst, codepoint, offset); - offset += 4; - this.highSurrogate = 0; - - continue; - } - } - - if (isHighSurrogate) - this.highSurrogate = code; - else { - // Even if the current character is a low surrogate, with no previous high surrogate, we'll - // encode it as a semi-invalid stand-alone character for the same reasons expressed above for - // unpaired high surrogates. - write32.call(dst, code, offset); - offset += 4; - this.highSurrogate = 0; - } - } - - if (offset < dst.length) - dst = dst.slice(0, offset); - - return dst; -}; - -Utf32Encoder.prototype.end = function() { - // Treat any leftover high surrogate as a semi-valid independent character. - if (!this.highSurrogate) - return; - - var buf = Buffer.alloc(4); - - if (this.isLE) - buf.writeUInt32LE(this.highSurrogate, 0); - else - buf.writeUInt32BE(this.highSurrogate, 0); - - this.highSurrogate = 0; - - return buf; -}; - -// -- Decoding - -function Utf32Decoder(options, codec) { - this.isLE = codec.isLE; - this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); - this.overflow = []; -} - -Utf32Decoder.prototype.write = function(src) { - if (src.length === 0) - return ''; - - var i = 0; - var codepoint = 0; - var dst = Buffer.alloc(src.length + 4); - var offset = 0; - var isLE = this.isLE; - var overflow = this.overflow; - var badChar = this.badChar; - - if (overflow.length > 0) { - for (; i < src.length && overflow.length < 4; i++) - overflow.push(src[i]); - - if (overflow.length === 4) { - // NOTE: codepoint is a signed int32 and can be negative. - // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). - if (isLE) { - codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); - } else { - codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); - } - overflow.length = 0; - - offset = _writeCodepoint(dst, offset, codepoint, badChar); - } - } - - // Main loop. Should be as optimized as possible. - for (; i < src.length - 3; i += 4) { - // NOTE: codepoint is a signed int32 and can be negative. - if (isLE) { - codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); - } else { - codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); - } - offset = _writeCodepoint(dst, offset, codepoint, badChar); - } - - // Keep overflowing bytes. - for (; i < src.length; i++) { - overflow.push(src[i]); - } - - return dst.slice(0, offset).toString('ucs2'); -}; - -function _writeCodepoint(dst, offset, codepoint, badChar) { - // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. - if (codepoint < 0 || codepoint > 0x10FFFF) { - // Not a valid Unicode codepoint - codepoint = badChar; - } - - // Ephemeral Planes: Write high surrogate. - if (codepoint >= 0x10000) { - codepoint -= 0x10000; - - var high = 0xD800 | (codepoint >> 10); - dst[offset++] = high & 0xff; - dst[offset++] = high >> 8; - - // Low surrogate is written below. - var codepoint = 0xDC00 | (codepoint & 0x3FF); - } - - // Write BMP char or low surrogate. - dst[offset++] = codepoint & 0xff; - dst[offset++] = codepoint >> 8; - - return offset; -}; - -Utf32Decoder.prototype.end = function() { - this.overflow.length = 0; -}; - -// == UTF-32 Auto codec ============================================================= -// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. -// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 -// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); - -// Encoder prepends BOM (which can be overridden with (addBOM: false}). - -exports.utf32 = Utf32AutoCodec; -exports.ucs4 = 'utf32'; - -function Utf32AutoCodec(options, iconv) { - this.iconv = iconv; -} - -Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; -Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; - -// -- Encoding - -function Utf32AutoEncoder(options, codec) { - options = options || {}; - - if (options.addBOM === undefined) - options.addBOM = true; - - this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); -} - -Utf32AutoEncoder.prototype.write = function(str) { - return this.encoder.write(str); -}; - -Utf32AutoEncoder.prototype.end = function() { - return this.encoder.end(); -}; - -// -- Decoding - -function Utf32AutoDecoder(options, codec) { - this.decoder = null; - this.initialBufs = []; - this.initialBufsLen = 0; - this.options = options || {}; - this.iconv = codec.iconv; -} - -Utf32AutoDecoder.prototype.write = function(buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf); - this.initialBufsLen += buf.length; - - if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) - return ''; - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.write(buf); -}; - -Utf32AutoDecoder.prototype.end = function() { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - var trail = this.decoder.end(); - if (trail) - resStr += trail; - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.end(); -}; - -function detectEncoding(bufs, defaultEncoding) { - var b = []; - var charsProcessed = 0; - var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. - var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. - - outer_loop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i]; - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]); - if (b.length === 4) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { - return 'utf-32le'; - } - if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { - return 'utf-32be'; - } - } - - if (b[0] !== 0 || b[1] > 0x10) invalidBE++; - if (b[3] !== 0 || b[2] > 0x10) invalidLE++; - - if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; - if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; - - b.length = 0; - charsProcessed++; - - if (charsProcessed >= 100) { - break outer_loop; - } - } - } - } - - // Make decisions. - if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; - if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || 'utf-32le'; -} - - -/***/ }), - -/***/ 43769: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var Buffer = __webpack_require__(52340).Buffer; - -// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 -// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 - -exports.utf7 = Utf7Codec; -exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 -function Utf7Codec(codecOptions, iconv) { - this.iconv = iconv; -}; - -Utf7Codec.prototype.encoder = Utf7Encoder; -Utf7Codec.prototype.decoder = Utf7Decoder; -Utf7Codec.prototype.bomAware = true; - - -// -- Encoding - -var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; - -function Utf7Encoder(options, codec) { - this.iconv = codec.iconv; -} - -Utf7Encoder.prototype.write = function(str) { - // Naive implementation. - // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". - return Buffer.from(str.replace(nonDirectChars, function(chunk) { - return "+" + (chunk === '+' ? '' : - this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) - + "-"; - }.bind(this))); -} - -Utf7Encoder.prototype.end = function() { -} - - -// -- Decoding - -function Utf7Decoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = ''; -} - -var base64Regex = /[A-Za-z0-9\/+]/; -var base64Chars = []; -for (var i = 0; i < 256; i++) - base64Chars[i] = base64Regex.test(String.fromCharCode(i)); - -var plusChar = '+'.charCodeAt(0), - minusChar = '-'.charCodeAt(0), - andChar = '&'.charCodeAt(0); - -Utf7Decoder.prototype.write = function(buf) { - var res = "", lastI = 0, - inBase64 = this.inBase64, - base64Accum = this.base64Accum; - - // The decoder is more involved as we must handle chunks in stream. - - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '+' - if (buf[i] == plusChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. - lastI = i+1; - inBase64 = true; - } - } else { // We decode base64. - if (!base64Chars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" - res += "+"; - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - if (buf[i] != minusChar) // Minus is absorbed after base64. - i--; - - lastI = i+1; - inBase64 = false; - base64Accum = ''; - } - } - } - - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); - - var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded); - - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - this.inBase64 = inBase64; - this.base64Accum = base64Accum; - - return res; -} - -Utf7Decoder.prototype.end = function() { - var res = ""; - if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - - this.inBase64 = false; - this.base64Accum = ''; - return res; -} - - -// UTF-7-IMAP codec. -// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) -// Differences: -// * Base64 part is started by "&" instead of "+" -// * Direct characters are 0x20-0x7E, except "&" (0x26) -// * In Base64, "," is used instead of "/" -// * Base64 must not be used to represent direct characters. -// * No implicit shift back from Base64 (should always end with '-') -// * String must end in non-shifted position. -// * "-&" while in base64 is not allowed. - - -exports.utf7imap = Utf7IMAPCodec; -function Utf7IMAPCodec(codecOptions, iconv) { - this.iconv = iconv; -}; - -Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; -Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; -Utf7IMAPCodec.prototype.bomAware = true; - - -// -- Encoding - -function Utf7IMAPEncoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = Buffer.alloc(6); - this.base64AccumIdx = 0; -} - -Utf7IMAPEncoder.prototype.write = function(str) { - var inBase64 = this.inBase64, - base64Accum = this.base64Accum, - base64AccumIdx = this.base64AccumIdx, - buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; - - for (var i = 0; i < str.length; i++) { - var uChar = str.charCodeAt(i); - if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. - if (inBase64) { - if (base64AccumIdx > 0) { - bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); - base64AccumIdx = 0; - } - - buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. - inBase64 = false; - } - - if (!inBase64) { - buf[bufIdx++] = uChar; // Write direct character - - if (uChar === andChar) // Ampersand -> '&-' - buf[bufIdx++] = minusChar; - } - - } else { // Non-direct character - if (!inBase64) { - buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. - inBase64 = true; - } - if (inBase64) { - base64Accum[base64AccumIdx++] = uChar >> 8; - base64Accum[base64AccumIdx++] = uChar & 0xFF; - - if (base64AccumIdx == base64Accum.length) { - bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); - base64AccumIdx = 0; - } - } - } - } - - this.inBase64 = inBase64; - this.base64AccumIdx = base64AccumIdx; - - return buf.slice(0, bufIdx); -} - -Utf7IMAPEncoder.prototype.end = function() { - var buf = Buffer.alloc(10), bufIdx = 0; - if (this.inBase64) { - if (this.base64AccumIdx > 0) { - bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); - this.base64AccumIdx = 0; - } - - buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. - this.inBase64 = false; - } - - return buf.slice(0, bufIdx); -} - - -// -- Decoding - -function Utf7IMAPDecoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = ''; -} - -var base64IMAPChars = base64Chars.slice(); -base64IMAPChars[','.charCodeAt(0)] = true; - -Utf7IMAPDecoder.prototype.write = function(buf) { - var res = "", lastI = 0, - inBase64 = this.inBase64, - base64Accum = this.base64Accum; - - // The decoder is more involved as we must handle chunks in stream. - // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). - - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '&' - if (buf[i] == andChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. - lastI = i+1; - inBase64 = true; - } - } else { // We decode base64. - if (!base64IMAPChars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" - res += "&"; - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - if (buf[i] != minusChar) // Minus may be absorbed after base64. - i--; - - lastI = i+1; - inBase64 = false; - base64Accum = ''; - } - } - } - - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); - - var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded); - - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - - this.inBase64 = inBase64; - this.base64Accum = base64Accum; - - return res; -} - -Utf7IMAPDecoder.prototype.end = function() { - var res = ""; - if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - - this.inBase64 = false; - this.base64Accum = ''; - return res; -} - - - - -/***/ }), - -/***/ 32223: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -var BOMChar = '\uFEFF'; - -exports.PrependBOM = PrependBOMWrapper -function PrependBOMWrapper(encoder, options) { - this.encoder = encoder; - this.addBOM = true; -} - -PrependBOMWrapper.prototype.write = function(str) { - if (this.addBOM) { - str = BOMChar + str; - this.addBOM = false; - } - - return this.encoder.write(str); -} - -PrependBOMWrapper.prototype.end = function() { - return this.encoder.end(); -} - - -//------------------------------------------------------------------------------ - -exports.StripBOM = StripBOMWrapper; -function StripBOMWrapper(decoder, options) { - this.decoder = decoder; - this.pass = false; - this.options = options || {}; -} - -StripBOMWrapper.prototype.write = function(buf) { - var res = this.decoder.write(buf); - if (this.pass || !res) - return res; - - if (res[0] === BOMChar) { - res = res.slice(1); - if (typeof this.options.stripBOM === 'function') - this.options.stripBOM(); - } - - this.pass = true; - return res; -} - -StripBOMWrapper.prototype.end = function() { - return this.decoder.end(); -} - - - -/***/ }), - -/***/ 24959: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Buffer = __webpack_require__(52340).Buffer; - -var bomHandling = __webpack_require__(32223), - iconv = module.exports; - -// All codecs and aliases are kept here, keyed by encoding name/alias. -// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. -iconv.encodings = null; - -// Characters emitted in case of error. -iconv.defaultCharUnicode = '�'; -iconv.defaultCharSingleByte = '?'; - -// Public API. -iconv.encode = function encode(str, encoding, options) { - str = "" + (str || ""); // Ensure string. - - var encoder = iconv.getEncoder(encoding, options); - - var res = encoder.write(str); - var trail = encoder.end(); - - return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; -} - -iconv.decode = function decode(buf, encoding, options) { - if (typeof buf === 'string') { - if (!iconv.skipDecodeWarning) { - console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); - iconv.skipDecodeWarning = true; - } - - buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. - } - - var decoder = iconv.getDecoder(encoding, options); - - var res = decoder.write(buf); - var trail = decoder.end(); - - return trail ? (res + trail) : res; -} - -iconv.encodingExists = function encodingExists(enc) { - try { - iconv.getCodec(enc); - return true; - } catch (e) { - return false; - } -} - -// Legacy aliases to convert functions -iconv.toEncoding = iconv.encode; -iconv.fromEncoding = iconv.decode; - -// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. -iconv._codecDataCache = {}; -iconv.getCodec = function getCodec(encoding) { - if (!iconv.encodings) - iconv.encodings = __webpack_require__(15761); // Lazy load all encoding definitions. - - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - var enc = iconv._canonicalizeEncoding(encoding); - - // Traverse iconv.encodings to find actual codec. - var codecOptions = {}; - while (true) { - var codec = iconv._codecDataCache[enc]; - if (codec) - return codec; - - var codecDef = iconv.encodings[enc]; - - switch (typeof codecDef) { - case "string": // Direct alias to other encoding. - enc = codecDef; - break; - - case "object": // Alias with options. Can be layered. - for (var key in codecDef) - codecOptions[key] = codecDef[key]; - - if (!codecOptions.encodingName) - codecOptions.encodingName = enc; - - enc = codecDef.type; - break; - - case "function": // Codec itself. - if (!codecOptions.encodingName) - codecOptions.encodingName = enc; - - // The codec function must load all tables and return object with .encoder and .decoder methods. - // It'll be called only once (for each different options object). - codec = new codecDef(codecOptions, iconv); - - iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. - return codec; - - default: - throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); - } - } -} - -iconv._canonicalizeEncoding = function(encoding) { - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); -} - -iconv.getEncoder = function getEncoder(encoding, options) { - var codec = iconv.getCodec(encoding), - encoder = new codec.encoder(options, codec); - - if (codec.bomAware && options && options.addBOM) - encoder = new bomHandling.PrependBOM(encoder, options); - - return encoder; -} - -iconv.getDecoder = function getDecoder(encoding, options) { - var codec = iconv.getCodec(encoding), - decoder = new codec.decoder(options, codec); - - if (codec.bomAware && !(options && options.stripBOM === false)) - decoder = new bomHandling.StripBOM(decoder, options); - - return decoder; -} - -// Streaming API -// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add -// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. -// If you would like to enable it explicitly, please add the following code to your app: -// > iconv.enableStreamingAPI(require('stream')); -iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { - if (iconv.supportsStreams) - return; - - // Dependency-inject stream module to create IconvLite stream classes. - var streams = __webpack_require__(11900)(stream_module); - - // Not public API yet, but expose the stream classes. - iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; - iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; - - // Streaming API. - iconv.encodeStream = function encodeStream(encoding, options) { - return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); - } - - iconv.decodeStream = function decodeStream(encoding, options) { - return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); - } - - iconv.supportsStreams = true; -} - -// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). -var stream_module; -try { - stream_module = __webpack_require__(92413); -} catch (e) {} - -if (stream_module && stream_module.Transform) { - iconv.enableStreamingAPI(stream_module); - -} else { - // In rare cases where 'stream' module is not available by default, throw a helpful exception. - iconv.encodeStream = iconv.decodeStream = function() { - throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); - }; -} - -if (false) {} - - -/***/ }), - -/***/ 11900: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Buffer = __webpack_require__(52340).Buffer; - -// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), -// we opt to dependency-inject it instead of creating a hard dependency. -module.exports = function(stream_module) { - var Transform = stream_module.Transform; - - // == Encoder stream ======================================================= - - function IconvLiteEncoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.decodeStrings = false; // We accept only strings, so we don't need to decode them. - Transform.call(this, options); - } - - IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteEncoderStream } - }); - - IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { - if (typeof chunk != 'string') - return done(new Error("Iconv encoding stream needs strings as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteEncoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteEncoderStream.prototype.collect = function(cb) { - var chunks = []; - this.on('error', cb); - this.on('data', function(chunk) { chunks.push(chunk); }); - this.on('end', function() { - cb(null, Buffer.concat(chunks)); - }); - return this; - } - - - // == Decoder stream ======================================================= - - function IconvLiteDecoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.encoding = this.encoding = 'utf8'; // We output strings. - Transform.call(this, options); - } - - IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteDecoderStream } - }); - - IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { - if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) - return done(new Error("Iconv decoding stream needs buffers as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteDecoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } - } - - IconvLiteDecoderStream.prototype.collect = function(cb) { - var res = ''; - this.on('error', cb); - this.on('data', function(chunk) { res += chunk; }); - this.on('end', function() { - cb(null, res); - }); - return this; - } - - return { - IconvLiteEncoderStream: IconvLiteEncoderStream, - IconvLiteDecoderStream: IconvLiteDecoderStream, - }; -}; - - -/***/ }), - -/***/ 11745: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var once = __webpack_require__(96754); - -var noop = function() {}; - -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; - -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 -}; - -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - var cancelled = false; - - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; - - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; - - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; - - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; - - var onerror = function(err) { - callback.call(stream, err); - }; - - var onclose = function() { - process.nextTick(onclosenexttick); - }; - - var onclosenexttick = function() { - if (cancelled) return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); - }; - - var onrequest = function() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - if (isChildProcess(stream)) stream.on('exit', onexit); - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - - return function() { - cancelled = true; - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; - -module.exports = eos; - - -/***/ }), - -/***/ 47727: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const path = __webpack_require__(85622); -const os = __webpack_require__(12087); - -const homedir = os.homedir(); -const tmpdir = os.tmpdir(); -const {env} = process; - -const macos = name => { - const library = path.join(homedir, 'Library'); - - return { - data: path.join(library, 'Application Support', name), - config: path.join(library, 'Preferences', name), - cache: path.join(library, 'Caches', name), - log: path.join(library, 'Logs', name), - temp: path.join(tmpdir, name) - }; -}; - -const windows = name => { - const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming'); - const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local'); - - return { - // Data/config/cache/log are invented by me as Windows isn't opinionated about this - data: path.join(localAppData, name, 'Data'), - config: path.join(appData, name, 'Config'), - cache: path.join(localAppData, name, 'Cache'), - log: path.join(localAppData, name, 'Log'), - temp: path.join(tmpdir, name) - }; -}; - -// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -const linux = name => { - const username = path.basename(homedir); - - return { - data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), - config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), - cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), - // https://wiki.debian.org/XDGBaseDirectorySpecification#state - log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), - temp: path.join(tmpdir, username, name) - }; -}; - -const envPaths = (name, options) => { - if (typeof name !== 'string') { - throw new TypeError(`Expected string, got ${typeof name}`); - } - - options = Object.assign({suffix: 'nodejs'}, options); - - if (options.suffix) { - // Add suffix to prevent possible conflict with native apps - name += `-${options.suffix}`; - } - - if (process.platform === 'darwin') { - return macos(name); - } - - if (process.platform === 'win32') { - return windows(name); - } - - return linux(name); -}; - -module.exports = envPaths; -// TODO: Remove this for the next major release -module.exports.default = envPaths; - - -/***/ }), - -/***/ 98361: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var util = __webpack_require__(31669); -var isArrayish = __webpack_require__(30237); - -var errorEx = function errorEx(name, properties) { - if (!name || name.constructor !== String) { - properties = name || {}; - name = Error.name; - } - - var errorExError = function ErrorEXError(message) { - if (!this) { - return new ErrorEXError(message); - } - - message = message instanceof Error - ? message.message - : (message || this.message); - - Error.call(this, message); - Error.captureStackTrace(this, errorExError); - - this.name = name; - - Object.defineProperty(this, 'message', { - configurable: true, - enumerable: false, - get: function () { - var newMessage = message.split(/\r?\n/g); - - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - - var modifier = properties[key]; - - if ('message' in modifier) { - newMessage = modifier.message(this[key], newMessage) || newMessage; - if (!isArrayish(newMessage)) { - newMessage = [newMessage]; - } - } - } - - return newMessage.join('\n'); - }, - set: function (v) { - message = v; - } - }); - - var overwrittenStack = null; - - var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); - var stackGetter = stackDescriptor.get; - var stackValue = stackDescriptor.value; - delete stackDescriptor.value; - delete stackDescriptor.writable; - - stackDescriptor.set = function (newstack) { - overwrittenStack = newstack; - }; - - stackDescriptor.get = function () { - var stack = (overwrittenStack || ((stackGetter) - ? stackGetter.call(this) - : stackValue)).split(/\r?\n+/g); - - // starting in Node 7, the stack builder caches the message. - // just replace it. - if (!overwrittenStack) { - stack[0] = this.name + ': ' + this.message; - } - - var lineCount = 1; - for (var key in properties) { - if (!properties.hasOwnProperty(key)) { - continue; - } - - var modifier = properties[key]; - - if ('line' in modifier) { - var line = modifier.line(this[key]); - if (line) { - stack.splice(lineCount++, 0, ' ' + line); - } - } - - if ('stack' in modifier) { - modifier.stack(this[key], stack); - } - } - - return stack.join('\n'); - }; - - Object.defineProperty(this, 'stack', stackDescriptor); - }; - - if (Object.setPrototypeOf) { - Object.setPrototypeOf(errorExError.prototype, Error.prototype); - Object.setPrototypeOf(errorExError, Error); - } else { - util.inherits(errorExError, Error); - } - - return errorExError; -}; - -errorEx.append = function (str, def) { - return { - message: function (v, message) { - v = v || def; - - if (v) { - message[0] += ' ' + str.replace('%s', v.toString()); - } - - return message; - } - }; -}; - -errorEx.line = function (str, def) { - return { - line: function (v) { - v = v || def; - - if (v) { - return str.replace('%s', v.toString()); - } - - return null; - } - }; -}; - -module.exports = errorEx; - - -/***/ }), - -/***/ 65393: -/***/ ((module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function _extendableBuiltin(cls) { - function ExtendableBuiltin() { - cls.apply(this, arguments); - } - - ExtendableBuiltin.prototype = Object.create(cls.prototype, { - constructor: { - value: cls, - enumerable: false, - writable: true, - configurable: true - } - }); - - if (Object.setPrototypeOf) { - Object.setPrototypeOf(ExtendableBuiltin, cls); - } else { - ExtendableBuiltin.__proto__ = cls; - } - - return ExtendableBuiltin; -} - -var ExtendableError = function (_extendableBuiltin2) { - _inherits(ExtendableError, _extendableBuiltin2); - - function ExtendableError() { - var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - - _classCallCheck(this, ExtendableError); - - // extending Error is weird and does not propagate `message` - var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); - - Object.defineProperty(_this, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }); - - Object.defineProperty(_this, 'name', { - configurable: true, - enumerable: false, - value: _this.constructor.name, - writable: true - }); - - if (Error.hasOwnProperty('captureStackTrace')) { - Error.captureStackTrace(_this, _this.constructor); - return _possibleConstructorReturn(_this); - } - - Object.defineProperty(_this, 'stack', { - configurable: true, - enumerable: false, - value: new Error(message).stack, - writable: true - }); - return _this; - } - - return ExtendableError; -}(_extendableBuiltin(Error)); - -exports.default = ExtendableError; -module.exports = exports['default']; - - -/***/ }), - -/***/ 5813: -/***/ ((module) => { - -"use strict"; - - -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(matchOperatorsRe, '\\$&'); -}; - - -/***/ }), - -/***/ 51737: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const path = __webpack_require__(85622); -const childProcess = __webpack_require__(63129); -const crossSpawn = __webpack_require__(23875); -const stripFinalNewline = __webpack_require__(50077); -const npmRunPath = __webpack_require__(79391); -const onetime = __webpack_require__(81053); -const makeError = __webpack_require__(35528); -const normalizeStdio = __webpack_require__(89816); -const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = __webpack_require__(51134); -const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __webpack_require__(15156); -const {mergePromise, getSpawnedPromise} = __webpack_require__(31045); -const {joinCommand, parseCommand} = __webpack_require__(36429); - -const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; - -const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { - const env = extendEnv ? {...process.env, ...envOption} : envOption; - - if (preferLocal) { - return npmRunPath.env({env, cwd: localDir, execPath}); - } - - return env; -}; - -const handleArguments = (file, args, options = {}) => { - const parsed = crossSpawn._parse(file, args, options); - file = parsed.command; - args = parsed.args; - options = parsed.options; - - options = { - maxBuffer: DEFAULT_MAX_BUFFER, - buffer: true, - stripFinalNewline: true, - extendEnv: true, - preferLocal: false, - localDir: options.cwd || process.cwd(), - execPath: process.execPath, - encoding: 'utf8', - reject: true, - cleanup: true, - all: false, - windowsHide: true, - ...options - }; - - options.env = getEnv(options); - - options.stdio = normalizeStdio(options); - - if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { - // #116 - args.unshift('/q'); - } - - return {file, args, options, parsed}; -}; - -const handleOutput = (options, value, error) => { - if (typeof value !== 'string' && !Buffer.isBuffer(value)) { - // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` - return error === undefined ? undefined : ''; - } - - if (options.stripFinalNewline) { - return stripFinalNewline(value); - } - - return value; -}; - -const execa = (file, args, options) => { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - - let spawned; - try { - spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); - } catch (error) { - // Ensure the returned error is always both a promise and a child process - const dummySpawned = new childProcess.ChildProcess(); - const errorPromise = Promise.reject(makeError({ - error, - stdout: '', - stderr: '', - all: '', - command, - parsed, - timedOut: false, - isCanceled: false, - killed: false - })); - return mergePromise(dummySpawned, errorPromise); - } - - const spawnedPromise = getSpawnedPromise(spawned); - const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); - const processDone = setExitHandler(spawned, parsed.options, timedPromise); - - const context = {isCanceled: false}; - - spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); - spawned.cancel = spawnedCancel.bind(null, spawned, context); - - const handlePromise = async () => { - const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); - const stdout = handleOutput(parsed.options, stdoutResult); - const stderr = handleOutput(parsed.options, stderrResult); - const all = handleOutput(parsed.options, allResult); - - if (error || exitCode !== 0 || signal !== null) { - const returnedError = makeError({ - error, - exitCode, - signal, - stdout, - stderr, - all, - command, - parsed, - timedOut, - isCanceled: context.isCanceled, - killed: spawned.killed - }); - - if (!parsed.options.reject) { - return returnedError; - } - - throw returnedError; - } - - return { - command, - exitCode: 0, - stdout, - stderr, - all, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; - }; - - const handlePromiseOnce = onetime(handlePromise); - - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - - handleInput(spawned, parsed.options.input); - - spawned.all = makeAllStream(spawned, parsed.options); - - return mergePromise(spawned, handlePromiseOnce); -}; - -module.exports = execa; - -module.exports.sync = (file, args, options) => { - const parsed = handleArguments(file, args, options); - const command = joinCommand(file, args); - - validateInputSync(parsed.options); - - let result; - try { - result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); - } catch (error) { - throw makeError({ - error, - stdout: '', - stderr: '', - all: '', - command, - parsed, - timedOut: false, - isCanceled: false, - killed: false - }); - } - - const stdout = handleOutput(parsed.options, result.stdout, result.error); - const stderr = handleOutput(parsed.options, result.stderr, result.error); - - if (result.error || result.status !== 0 || result.signal !== null) { - const error = makeError({ - stdout, - stderr, - error: result.error, - signal: result.signal, - exitCode: result.status, - command, - parsed, - timedOut: result.error && result.error.code === 'ETIMEDOUT', - isCanceled: false, - killed: result.signal !== null - }); - - if (!parsed.options.reject) { - return error; - } - - throw error; - } - - return { - command, - exitCode: 0, - stdout, - stderr, - failed: false, - timedOut: false, - isCanceled: false, - killed: false - }; -}; - -module.exports.command = (command, options) => { - const [file, ...args] = parseCommand(command); - return execa(file, args, options); -}; - -module.exports.commandSync = (command, options) => { - const [file, ...args] = parseCommand(command); - return execa.sync(file, args, options); -}; - -module.exports.node = (scriptPath, args, options = {}) => { - if (args && !Array.isArray(args) && typeof args === 'object') { - options = args; - args = []; - } - - const stdio = normalizeStdio.node(options); - const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect')); - - const { - nodePath = process.execPath, - nodeOptions = defaultExecArgv - } = options; - - return execa( - nodePath, - [ - ...nodeOptions, - scriptPath, - ...(Array.isArray(args) ? args : []) - ], - { - ...options, - stdin: undefined, - stdout: undefined, - stderr: undefined, - stdio, - shell: false - } - ); -}; - - -/***/ }), - -/***/ 36429: -/***/ ((module) => { - -"use strict"; - -const SPACES_REGEXP = / +/g; - -const joinCommand = (file, args = []) => { - if (!Array.isArray(args)) { - return file; - } - - return [file, ...args].join(' '); -}; - -// Handle `execa.command()` -const parseCommand = command => { - const tokens = []; - for (const token of command.trim().split(SPACES_REGEXP)) { - // Allow spaces to be escaped by a backslash if not meant as a delimiter - const previousToken = tokens[tokens.length - 1]; - if (previousToken && previousToken.endsWith('\\')) { - // Merge previous token with current one - tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; - } else { - tokens.push(token); - } - } - - return tokens; -}; - -module.exports = { - joinCommand, - parseCommand -}; - - -/***/ }), - -/***/ 35528: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const {signalsByName} = __webpack_require__(18694); - -const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { - if (timedOut) { - return `timed out after ${timeout} milliseconds`; - } - - if (isCanceled) { - return 'was canceled'; - } - - if (errorCode !== undefined) { - return `failed with ${errorCode}`; - } - - if (signal !== undefined) { - return `was killed with ${signal} (${signalDescription})`; - } - - if (exitCode !== undefined) { - return `failed with exit code ${exitCode}`; - } - - return 'failed'; -}; - -const makeError = ({ - stdout, - stderr, - all, - error, - signal, - exitCode, - command, - timedOut, - isCanceled, - killed, - parsed: {options: {timeout}} -}) => { - // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. - // We normalize them to `undefined` - exitCode = exitCode === null ? undefined : exitCode; - signal = signal === null ? undefined : signal; - const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; - - const errorCode = error && error.code; - - const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); - const execaMessage = `Command ${prefix}: ${command}`; - const isError = Object.prototype.toString.call(error) === '[object Error]'; - const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; - const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); - - if (isError) { - error.originalMessage = error.message; - error.message = message; - } else { - error = new Error(message); - } - - error.shortMessage = shortMessage; - error.command = command; - error.exitCode = exitCode; - error.signal = signal; - error.signalDescription = signalDescription; - error.stdout = stdout; - error.stderr = stderr; - - if (all !== undefined) { - error.all = all; - } - - if ('bufferedData' in error) { - delete error.bufferedData; - } - - error.failed = true; - error.timedOut = Boolean(timedOut); - error.isCanceled = isCanceled; - error.killed = killed && !timedOut; - - return error; -}; - -module.exports = makeError; - - -/***/ }), - -/***/ 51134: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const os = __webpack_require__(12087); -const onExit = __webpack_require__(22317); - -const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; - -// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior -const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { - const killResult = kill(signal); - setKillTimeout(kill, signal, options, killResult); - return killResult; -}; - -const setKillTimeout = (kill, signal, options, killResult) => { - if (!shouldForceKill(signal, options, killResult)) { - return; - } - - const timeout = getForceKillAfterTimeout(options); - const t = setTimeout(() => { - kill('SIGKILL'); - }, timeout); - - // Guarded because there's no `.unref()` when `execa` is used in the renderer - // process in Electron. This cannot be tested since we don't run tests in - // Electron. - // istanbul ignore else - if (t.unref) { - t.unref(); - } -}; - -const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { - return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; -}; - -const isSigterm = signal => { - return signal === os.constants.signals.SIGTERM || - (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); -}; - -const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { - if (forceKillAfterTimeout === true) { - return DEFAULT_FORCE_KILL_TIMEOUT; - } - - if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { - throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); - } - - return forceKillAfterTimeout; -}; - -// `childProcess.cancel()` -const spawnedCancel = (spawned, context) => { - const killResult = spawned.kill(); - - if (killResult) { - context.isCanceled = true; - } -}; - -const timeoutKill = (spawned, signal, reject) => { - spawned.kill(signal); - reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); -}; - -// `timeout` option handling -const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { - if (timeout === 0 || timeout === undefined) { - return spawnedPromise; - } - - if (!Number.isFinite(timeout) || timeout < 0) { - throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); - } - - let timeoutId; - const timeoutPromise = new Promise((resolve, reject) => { - timeoutId = setTimeout(() => { - timeoutKill(spawned, killSignal, reject); - }, timeout); - }); - - const safeSpawnedPromise = spawnedPromise.finally(() => { - clearTimeout(timeoutId); - }); - - return Promise.race([timeoutPromise, safeSpawnedPromise]); -}; - -// `cleanup` option handling -const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { - if (!cleanup || detached) { - return timedPromise; - } - - const removeExitHandler = onExit(() => { - spawned.kill(); - }); - - return timedPromise.finally(() => { - removeExitHandler(); - }); -}; - -module.exports = { - spawnedKill, - spawnedCancel, - setupTimeout, - setExitHandler -}; - - -/***/ }), - -/***/ 31045: -/***/ ((module) => { - -"use strict"; - - -const nativePromisePrototype = (async () => {})().constructor.prototype; -const descriptors = ['then', 'catch', 'finally'].map(property => [ - property, - Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) -]); - -// The return value is a mixin of `childProcess` and `Promise` -const mergePromise = (spawned, promise) => { - for (const [property, descriptor] of descriptors) { - // Starting the main `promise` is deferred to avoid consuming streams - const value = typeof promise === 'function' ? - (...args) => Reflect.apply(descriptor.value, promise(), args) : - descriptor.value.bind(promise); - - Reflect.defineProperty(spawned, property, {...descriptor, value}); - } - - return spawned; -}; - -// Use promises instead of `child_process` events -const getSpawnedPromise = spawned => { - return new Promise((resolve, reject) => { - spawned.on('exit', (exitCode, signal) => { - resolve({exitCode, signal}); - }); - - spawned.on('error', error => { - reject(error); - }); - - if (spawned.stdin) { - spawned.stdin.on('error', error => { - reject(error); - }); - } - }); -}; - -module.exports = { - mergePromise, - getSpawnedPromise -}; - - - -/***/ }), - -/***/ 89816: -/***/ ((module) => { - -"use strict"; - -const aliases = ['stdin', 'stdout', 'stderr']; - -const hasAlias = opts => aliases.some(alias => opts[alias] !== undefined); - -const normalizeStdio = opts => { - if (!opts) { - return; - } - - const {stdio} = opts; - - if (stdio === undefined) { - return aliases.map(alias => opts[alias]); - } - - if (hasAlias(opts)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); - } - - if (typeof stdio === 'string') { - return stdio; - } - - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } - - const length = Math.max(stdio.length, aliases.length); - return Array.from({length}, (value, index) => stdio[index]); -}; - -module.exports = normalizeStdio; - -// `ipc` is pushed unless it is already present -module.exports.node = opts => { - const stdio = normalizeStdio(opts); - - if (stdio === 'ipc') { - return 'ipc'; - } - - if (stdio === undefined || typeof stdio === 'string') { - return [stdio, stdio, stdio, 'ipc']; - } - - if (stdio.includes('ipc')) { - return stdio; - } - - return [...stdio, 'ipc']; -}; - - -/***/ }), - -/***/ 15156: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const isStream = __webpack_require__(93458); -const getStream = __webpack_require__(63886); -const mergeStream = __webpack_require__(6020); - -// `input` option -const handleInput = (spawned, input) => { - // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 - // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 - if (input === undefined || spawned.stdin === undefined) { - return; - } - - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -}; - -// `all` interleaves `stdout` and `stderr` -const makeAllStream = (spawned, {all}) => { - if (!all || (!spawned.stdout && !spawned.stderr)) { - return; - } - - const mixed = mergeStream(); - - if (spawned.stdout) { - mixed.add(spawned.stdout); - } - - if (spawned.stderr) { - mixed.add(spawned.stderr); - } - - return mixed; -}; - -// On failure, `result.stdout|stderr|all` should contain the currently buffered stream -const getBufferedData = async (stream, streamPromise) => { - if (!stream) { - return; - } - - stream.destroy(); - - try { - return await streamPromise; - } catch (error) { - return error.bufferedData; - } -}; - -const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { - if (!stream || !buffer) { - return; - } - - if (encoding) { - return getStream(stream, {encoding, maxBuffer}); - } - - return getStream.buffer(stream, {maxBuffer}); -}; - -// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) -const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { - const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); - const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); - const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); - - try { - return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); - } catch (error) { - return Promise.all([ - {error, signal: error.signal, timedOut: error.timedOut}, - getBufferedData(stdout, stdoutPromise), - getBufferedData(stderr, stderrPromise), - getBufferedData(all, allPromise) - ]); - } -}; - -const validateInputSync = ({input}) => { - if (isStream(input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } -}; - -module.exports = { - handleInput, - makeAllStream, - getSpawnedResult, - validateInputSync -}; - - - -/***/ }), - -/***/ 3718: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -/*! - * expand-tilde - * - * Copyright (c) 2015 Jon Schlinkert. - * Licensed under the MIT license. - */ - -var homedir = __webpack_require__(56530); -var path = __webpack_require__(85622); - -module.exports = function expandTilde(filepath) { - var home = homedir(); - - if (filepath.charCodeAt(0) === 126 /* ~ */) { - if (filepath.charCodeAt(1) === 43 /* + */) { - return path.join(process.cwd(), filepath.slice(2)); - } - return home ? path.join(home, filepath.slice(1)) : filepath; - } - - return filepath; -}; - - -/***/ }), - -/***/ 2933: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const debug = __webpack_require__(30787)('extract-zip') -// eslint-disable-next-line node/no-unsupported-features/node-builtins -const { createWriteStream, promises: fs } = __webpack_require__(35747) -const getStream = __webpack_require__(63886) -const path = __webpack_require__(85622) -const { promisify } = __webpack_require__(31669) -const stream = __webpack_require__(92413) -const yauzl = __webpack_require__(8245) - -const openZip = promisify(yauzl.open) -const pipeline = promisify(stream.pipeline) - -class Extractor { - constructor (zipPath, opts) { - this.zipPath = zipPath - this.opts = opts - } - - async extract () { - debug('opening', this.zipPath, 'with opts', this.opts) - - this.zipfile = await openZip(this.zipPath, { lazyEntries: true }) - this.canceled = false - - return new Promise((resolve, reject) => { - this.zipfile.on('error', err => { - this.canceled = true - reject(err) - }) - this.zipfile.readEntry() - - this.zipfile.on('close', () => { - if (!this.canceled) { - debug('zip extraction complete') - resolve() - } - }) - - this.zipfile.on('entry', async entry => { - /* istanbul ignore if */ - if (this.canceled) { - debug('skipping entry', entry.fileName, { cancelled: this.canceled }) - return - } - - debug('zipfile entry', entry.fileName) - - if (entry.fileName.startsWith('__MACOSX/')) { - this.zipfile.readEntry() - return - } - - const destDir = path.dirname(path.join(this.opts.dir, entry.fileName)) - - try { - await fs.mkdir(destDir, { recursive: true }) - - const canonicalDestDir = await fs.realpath(destDir) - const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir) - - if (relativeDestDir.split(path.sep).includes('..')) { - throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`) - } - - await this.extractEntry(entry) - debug('finished processing', entry.fileName) - this.zipfile.readEntry() - } catch (err) { - this.canceled = true - this.zipfile.close() - reject(err) - } - }) - }) - } - - async extractEntry (entry) { - /* istanbul ignore if */ - if (this.canceled) { - debug('skipping entry extraction', entry.fileName, { cancelled: this.canceled }) - return - } - - if (this.opts.onEntry) { - this.opts.onEntry(entry, this.zipfile) - } - - const dest = path.join(this.opts.dir, entry.fileName) - - // convert external file attr int into a fs stat mode int - const mode = (entry.externalFileAttributes >> 16) & 0xFFFF - // check if it's a symlink or dir (using stat mode constants) - const IFMT = 61440 - const IFDIR = 16384 - const IFLNK = 40960 - const symlink = (mode & IFMT) === IFLNK - let isDir = (mode & IFMT) === IFDIR - - // Failsafe, borrowed from jsZip - if (!isDir && entry.fileName.endsWith('/')) { - isDir = true - } - - // check for windows weird way of specifying a directory - // https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566 - const madeBy = entry.versionMadeBy >> 8 - if (!isDir) isDir = (madeBy === 0 && entry.externalFileAttributes === 16) - - debug('extracting entry', { filename: entry.fileName, isDir: isDir, isSymlink: symlink }) - - const procMode = this.getExtractedMode(mode, isDir) & 0o777 - - // always ensure folders are created - const destDir = isDir ? dest : path.dirname(dest) - - const mkdirOptions = { recursive: true } - if (isDir) { - mkdirOptions.mode = procMode - } - debug('mkdir', { dir: destDir, ...mkdirOptions }) - await fs.mkdir(destDir, mkdirOptions) - if (isDir) return - - debug('opening read stream', dest) - const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry) - - if (symlink) { - const link = await getStream(readStream) - debug('creating symlink', link, dest) - await fs.symlink(link, dest) - } else { - await pipeline(readStream, createWriteStream(dest, { mode: procMode })) - } - } - - getExtractedMode (entryMode, isDir) { - let mode = entryMode - // Set defaults, if necessary - if (mode === 0) { - if (isDir) { - if (this.opts.defaultDirMode) { - mode = parseInt(this.opts.defaultDirMode, 10) - } - - if (!mode) { - mode = 0o755 - } - } else { - if (this.opts.defaultFileMode) { - mode = parseInt(this.opts.defaultFileMode, 10) - } - - if (!mode) { - mode = 0o644 - } - } - } - - return mode - } -} - -module.exports = async function (zipPath, opts) { - debug('creating target directory', opts.dir) - - if (!path.isAbsolute(opts.dir)) { - throw new Error('Target directory is expected to be absolute') - } - - await fs.mkdir(opts.dir, { recursive: true }) - opts.dir = await fs.realpath(opts.dir) - return new Extractor(zipPath, opts).extract() -} - - -/***/ }), - -/***/ 92104: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -var fs = __webpack_require__(35747); -var util = __webpack_require__(31669); -var stream = __webpack_require__(92413); -var Readable = stream.Readable; -var Writable = stream.Writable; -var PassThrough = stream.PassThrough; -var Pend = __webpack_require__(71932); -var EventEmitter = __webpack_require__(28614).EventEmitter; - -exports.createFromBuffer = createFromBuffer; -exports.createFromFd = createFromFd; -exports.BufferSlicer = BufferSlicer; -exports.FdSlicer = FdSlicer; - -util.inherits(FdSlicer, EventEmitter); -function FdSlicer(fd, options) { - options = options || {}; - EventEmitter.call(this); - - this.fd = fd; - this.pend = new Pend(); - this.pend.max = 1; - this.refCount = 0; - this.autoClose = !!options.autoClose; -} - -FdSlicer.prototype.read = function(buffer, offset, length, position, callback) { - var self = this; - self.pend.go(function(cb) { - fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) { - cb(); - callback(err, bytesRead, buffer); - }); - }); -}; - -FdSlicer.prototype.write = function(buffer, offset, length, position, callback) { - var self = this; - self.pend.go(function(cb) { - fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) { - cb(); - callback(err, written, buffer); - }); - }); -}; - -FdSlicer.prototype.createReadStream = function(options) { - return new ReadStream(this, options); -}; - -FdSlicer.prototype.createWriteStream = function(options) { - return new WriteStream(this, options); -}; - -FdSlicer.prototype.ref = function() { - this.refCount += 1; -}; - -FdSlicer.prototype.unref = function() { - var self = this; - self.refCount -= 1; - - if (self.refCount > 0) return; - if (self.refCount < 0) throw new Error("invalid unref"); - - if (self.autoClose) { - fs.close(self.fd, onCloseDone); - } - - function onCloseDone(err) { - if (err) { - self.emit('error', err); - } else { - self.emit('close'); - } - } -}; - -util.inherits(ReadStream, Readable); -function ReadStream(context, options) { - options = options || {}; - Readable.call(this, options); - - this.context = context; - this.context.ref(); - - this.start = options.start || 0; - this.endOffset = options.end; - this.pos = this.start; - this.destroyed = false; -} - -ReadStream.prototype._read = function(n) { - var self = this; - if (self.destroyed) return; - - var toRead = Math.min(self._readableState.highWaterMark, n); - if (self.endOffset != null) { - toRead = Math.min(toRead, self.endOffset - self.pos); - } - if (toRead <= 0) { - self.destroyed = true; - self.push(null); - self.context.unref(); - return; - } - self.context.pend.go(function(cb) { - if (self.destroyed) return cb(); - var buffer = new Buffer(toRead); - fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) { - if (err) { - self.destroy(err); - } else if (bytesRead === 0) { - self.destroyed = true; - self.push(null); - self.context.unref(); - } else { - self.pos += bytesRead; - self.push(buffer.slice(0, bytesRead)); - } - cb(); - }); - }); -}; - -ReadStream.prototype.destroy = function(err) { - if (this.destroyed) return; - err = err || new Error("stream destroyed"); - this.destroyed = true; - this.emit('error', err); - this.context.unref(); -}; - -util.inherits(WriteStream, Writable); -function WriteStream(context, options) { - options = options || {}; - Writable.call(this, options); - - this.context = context; - this.context.ref(); - - this.start = options.start || 0; - this.endOffset = (options.end == null) ? Infinity : +options.end; - this.bytesWritten = 0; - this.pos = this.start; - this.destroyed = false; - - this.on('finish', this.destroy.bind(this)); -} - -WriteStream.prototype._write = function(buffer, encoding, callback) { - var self = this; - if (self.destroyed) return; - - if (self.pos + buffer.length > self.endOffset) { - var err = new Error("maximum file length exceeded"); - err.code = 'ETOOBIG'; - self.destroy(); - callback(err); - return; - } - self.context.pend.go(function(cb) { - if (self.destroyed) return cb(); - fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) { - if (err) { - self.destroy(); - cb(); - callback(err); - } else { - self.bytesWritten += bytes; - self.pos += bytes; - self.emit('progress'); - cb(); - callback(); - } - }); - }); -}; - -WriteStream.prototype.destroy = function() { - if (this.destroyed) return; - this.destroyed = true; - this.context.unref(); -}; - -util.inherits(BufferSlicer, EventEmitter); -function BufferSlicer(buffer, options) { - EventEmitter.call(this); - - options = options || {}; - this.refCount = 0; - this.buffer = buffer; - this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER; -} - -BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) { - var end = position + length; - var delta = end - this.buffer.length; - var written = (delta > 0) ? delta : length; - this.buffer.copy(buffer, offset, position, end); - setImmediate(function() { - callback(null, written); - }); -}; - -BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) { - buffer.copy(this.buffer, position, offset, offset + length); - setImmediate(function() { - callback(null, length, buffer); - }); -}; - -BufferSlicer.prototype.createReadStream = function(options) { - options = options || {}; - var readStream = new PassThrough(options); - readStream.destroyed = false; - readStream.start = options.start || 0; - readStream.endOffset = options.end; - // by the time this function returns, we'll be done. - readStream.pos = readStream.endOffset || this.buffer.length; - - // respect the maxChunkSize option to slice up the chunk into smaller pieces. - var entireSlice = this.buffer.slice(readStream.start, readStream.pos); - var offset = 0; - while (true) { - var nextOffset = offset + this.maxChunkSize; - if (nextOffset >= entireSlice.length) { - // last chunk - if (offset < entireSlice.length) { - readStream.write(entireSlice.slice(offset, entireSlice.length)); - } - break; - } - readStream.write(entireSlice.slice(offset, nextOffset)); - offset = nextOffset; - } - - readStream.end(); - readStream.destroy = function() { - readStream.destroyed = true; - }; - return readStream; -}; - -BufferSlicer.prototype.createWriteStream = function(options) { - var bufferSlicer = this; - options = options || {}; - var writeStream = new Writable(options); - writeStream.start = options.start || 0; - writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end; - writeStream.bytesWritten = 0; - writeStream.pos = writeStream.start; - writeStream.destroyed = false; - writeStream._write = function(buffer, encoding, callback) { - if (writeStream.destroyed) return; - - var end = writeStream.pos + buffer.length; - if (end > writeStream.endOffset) { - var err = new Error("maximum file length exceeded"); - err.code = 'ETOOBIG'; - writeStream.destroyed = true; - callback(err); - return; - } - buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length); - - writeStream.bytesWritten += buffer.length; - writeStream.pos = end; - writeStream.emit('progress'); - callback(); - }; - writeStream.destroy = function() { - writeStream.destroyed = true; - }; - return writeStream; -}; - -BufferSlicer.prototype.ref = function() { - this.refCount += 1; -}; - -BufferSlicer.prototype.unref = function() { - this.refCount -= 1; - - if (this.refCount < 0) { - throw new Error("invalid unref"); - } -}; - -function createFromBuffer(buffer, options) { - return new BufferSlicer(buffer, options); -} - -function createFromFd(fd, options) { - return new FdSlicer(fd, options); -} - - -/***/ }), - -/***/ 66521: -/***/ ((module) => { - -"use strict"; - -module.exports = function () { - return /[<>:"\/\\|?*]/g; -}; - - -/***/ }), - -/***/ 63088: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var filenamify = __webpack_require__(25686); -var humanizeUrl = __webpack_require__(52111); - -module.exports = function (str, opts) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return filenamify(humanizeUrl(str), opts); -}; - - -/***/ }), - -/***/ 25686: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var path = __webpack_require__(85622); -var trimRepeated = __webpack_require__(33533); -var filenameReservedRegex = __webpack_require__(66521); -var stripOuter = __webpack_require__(77901); - -// doesn't make sense to have longer filenames -var MAX_FILENAME_LENGTH = 100; - -var reControlChars = /[\x00-\x1f\x80-\x9f]/g; -var reRelativePath = /^\.+/; - -var fn = module.exports = function (str, opts) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - opts = opts || {}; - - var replacement = opts.replacement || '!'; - - if (filenameReservedRegex().test(replacement) && reControlChars.test(replacement)) { - throw new Error('Replacement string cannot contain reserved filename characters'); - } - - str = str.replace(filenameReservedRegex(), replacement); - str = str.replace(reControlChars, replacement); - str = str.replace(reRelativePath, replacement); - - if (replacement.length > 0) { - str = trimRepeated(str, replacement); - str = str.length > 1 ? stripOuter(str, replacement) : str; - } - - str = str.slice(0, MAX_FILENAME_LENGTH); - - return str; -}; - -fn.path = function (pth, opts) { - pth = path.resolve(pth); - return path.join(path.dirname(pth), fn(path.basename(pth), opts)); -}; - - -/***/ }), - -/***/ 35955: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/*! - * fill-range - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -const util = __webpack_require__(31669); -const toRegexRange = __webpack_require__(1353); - -const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); - -const transform = toNumber => { - return value => toNumber === true ? Number(value) : String(value); -}; - -const isValidValue = value => { - return typeof value === 'number' || (typeof value === 'string' && value !== ''); -}; - -const isNumber = num => Number.isInteger(+num); - -const zeros = input => { - let value = `${input}`; - let index = -1; - if (value[0] === '-') value = value.slice(1); - if (value === '0') return false; - while (value[++index] === '0'); - return index > 0; -}; - -const stringify = (start, end, options) => { - if (typeof start === 'string' || typeof end === 'string') { - return true; - } - return options.stringify === true; -}; - -const pad = (input, maxLength, toNumber) => { - if (maxLength > 0) { - let dash = input[0] === '-' ? '-' : ''; - if (dash) input = input.slice(1); - input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); - } - if (toNumber === false) { - return String(input); - } - return input; -}; - -const toMaxLen = (input, maxLength) => { - let negative = input[0] === '-' ? '-' : ''; - if (negative) { - input = input.slice(1); - maxLength--; - } - while (input.length < maxLength) input = '0' + input; - return negative ? ('-' + input) : input; -}; - -const toSequence = (parts, options) => { - parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - - let prefix = options.capture ? '' : '?:'; - let positives = ''; - let negatives = ''; - let result; - - if (parts.positives.length) { - positives = parts.positives.join('|'); - } - - if (parts.negatives.length) { - negatives = `-(${prefix}${parts.negatives.join('|')})`; - } - - if (positives && negatives) { - result = `${positives}|${negatives}`; - } else { - result = positives || negatives; - } - - if (options.wrap) { - return `(${prefix}${result})`; - } - - return result; -}; - -const toRange = (a, b, isNumbers, options) => { - if (isNumbers) { - return toRegexRange(a, b, { wrap: false, ...options }); - } - - let start = String.fromCharCode(a); - if (a === b) return start; - - let stop = String.fromCharCode(b); - return `[${start}-${stop}]`; -}; - -const toRegex = (start, end, options) => { - if (Array.isArray(start)) { - let wrap = options.wrap === true; - let prefix = options.capture ? '' : '?:'; - return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); - } - return toRegexRange(start, end, options); -}; - -const rangeError = (...args) => { - return new RangeError('Invalid range arguments: ' + util.inspect(...args)); -}; - -const invalidRange = (start, end, options) => { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; -}; - -const invalidStep = (step, options) => { - if (options.strictRanges === true) { - throw new TypeError(`Expected step "${step}" to be a number`); - } - return []; -}; - -const fillNumbers = (start, end, step = 1, options = {}) => { - let a = Number(start); - let b = Number(end); - - if (!Number.isInteger(a) || !Number.isInteger(b)) { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; - } - - // fix negative zero - if (a === 0) a = 0; - if (b === 0) b = 0; - - let descending = a > b; - let startString = String(start); - let endString = String(end); - let stepString = String(step); - step = Math.max(Math.abs(step), 1); - - let padded = zeros(startString) || zeros(endString) || zeros(stepString); - let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify(start, end, options) === false; - let format = options.transform || transform(toNumber); - - if (options.toRegex && step === 1) { - return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); - } - - let parts = { negatives: [], positives: [] }; - let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - if (options.toRegex === true && step > 1) { - push(a); - } else { - range.push(pad(format(a, index), maxLen, toNumber)); - } - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return step > 1 - ? toSequence(parts, options) - : toRegex(range, null, { wrap: false, ...options }); - } - - return range; -}; - -const fillLetters = (start, end, step = 1, options = {}) => { - if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { - return invalidRange(start, end, options); - } - - - let format = options.transform || (val => String.fromCharCode(val)); - let a = `${start}`.charCodeAt(0); - let b = `${end}`.charCodeAt(0); - - let descending = a > b; - let min = Math.min(a, b); - let max = Math.max(a, b); - - if (options.toRegex && step === 1) { - return toRange(min, max, false, options); - } - - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - range.push(format(a, index)); - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return toRegex(range, null, { wrap: false, options }); - } - - return range; -}; - -const fill = (start, end, step, options = {}) => { - if (end == null && isValidValue(start)) { - return [start]; - } - - if (!isValidValue(start) || !isValidValue(end)) { - return invalidRange(start, end, options); - } - - if (typeof step === 'function') { - return fill(start, end, 1, { transform: step }); - } - - if (isObject(step)) { - return fill(start, end, 0, step); - } - - let opts = { ...options }; - if (opts.capture === true) opts.wrap = true; - step = step || opts.step || 1; - - if (!isNumber(step)) { - if (step != null && !isObject(step)) return invalidStep(step, opts); - return fill(start, end, 1, step); - } - - if (isNumber(start) && isNumber(end)) { - return fillNumbers(start, end, step, opts); - } - - return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); -}; - -module.exports = fill; - - -/***/ }), - -/***/ 2885: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const path = __webpack_require__(85622); -const locatePath = __webpack_require__(30815); -const pathExists = __webpack_require__(89255); - -const stop = Symbol('findUp.stop'); - -module.exports = async (name, options = {}) => { - let directory = path.resolve(options.cwd || ''); - const {root} = path.parse(directory); - const paths = [].concat(name); - - const runMatcher = async locateOptions => { - if (typeof name !== 'function') { - return locatePath(paths, locateOptions); - } - - const foundPath = await name(locateOptions.cwd); - if (typeof foundPath === 'string') { - return locatePath([foundPath], locateOptions); - } - - return foundPath; - }; - - // eslint-disable-next-line no-constant-condition - while (true) { - // eslint-disable-next-line no-await-in-loop - const foundPath = await runMatcher({...options, cwd: directory}); - - if (foundPath === stop) { - return; - } - - if (foundPath) { - return path.resolve(directory, foundPath); - } - - if (directory === root) { - return; - } - - directory = path.dirname(directory); - } -}; - -module.exports.sync = (name, options = {}) => { - let directory = path.resolve(options.cwd || ''); - const {root} = path.parse(directory); - const paths = [].concat(name); - - const runMatcher = locateOptions => { - if (typeof name !== 'function') { - return locatePath.sync(paths, locateOptions); - } - - const foundPath = name(locateOptions.cwd); - if (typeof foundPath === 'string') { - return locatePath.sync([foundPath], locateOptions); - } - - return foundPath; - }; - - // eslint-disable-next-line no-constant-condition - while (true) { - const foundPath = runMatcher({...options, cwd: directory}); - - if (foundPath === stop) { - return; - } - - if (foundPath) { - return path.resolve(directory, foundPath); - } - - if (directory === root) { - return; - } - - directory = path.dirname(directory); - } -}; - -module.exports.exists = pathExists; - -module.exports.sync.exists = pathExists.sync; - -module.exports.stop = stop; - - -/***/ }), - -/***/ 89255: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const fs = __webpack_require__(35747); -const {promisify} = __webpack_require__(31669); - -const pAccess = promisify(fs.access); - -module.exports = async path => { - try { - await pAccess(path); - return true; - } catch (_) { - return false; - } -}; - -module.exports.sync = path => { - try { - fs.accessSync(path); - return true; - } catch (_) { - return false; - } -}; - - -/***/ }), - -/***/ 20219: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -/** - * Module dependencies - */ - -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var isGlob = __webpack_require__(2182); -var resolveDir = __webpack_require__(20493); -var detect = __webpack_require__(3402); -var mm = __webpack_require__(78885); - -/** - * @param {String|Array} `pattern` Glob pattern or file path(s) to match against. - * @param {Object} `options` Options to pass to [micromatch]. Note that if you want to start in a different directory than the current working directory, specify the `options.cwd` property here. - * @return {String} Returns the first matching file. - * @api public - */ - -module.exports = function(patterns, options) { - options = options || {}; - var cwd = path.resolve(resolveDir(options.cwd || '')); - - if (typeof patterns === 'string') { - return lookup(cwd, [patterns], options); - } - - if (!Array.isArray(patterns)) { - throw new TypeError('findup-sync expects a string or array as the first argument.'); - } - - return lookup(cwd, patterns, options); -}; - -function lookup(cwd, patterns, options) { - var len = patterns.length; - var idx = -1; - var res; - - while (++idx < len) { - if (isGlob(patterns[idx])) { - res = matchFile(cwd, patterns[idx], options); - } else { - res = findFile(cwd, patterns[idx], options); - } - if (res) { - return res; - } - } - - var dir = path.dirname(cwd); - if (dir === cwd) { - return null; - } - return lookup(dir, patterns, options); -} - -function matchFile(cwd, pattern, opts) { - var isMatch = mm.matcher(pattern, opts); - var files = tryReaddirSync(cwd); - var len = files.length; - var idx = -1; - - while (++idx < len) { - var name = files[idx]; - var fp = path.join(cwd, name); - if (isMatch(name) || isMatch(fp)) { - return fp; - } - } - return null; -} - -function findFile(cwd, filename, options) { - var fp = cwd ? path.resolve(cwd, filename) : filename; - return detect(fp, options); -} - -function tryReaddirSync(fp) { - try { - return fs.readdirSync(fp); - } catch (err) { - // Ignore error - } - return []; -} - - -/***/ }), - -/***/ 78885: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const util = __webpack_require__(31669); -const braces = __webpack_require__(22706); -const picomatch = __webpack_require__(5669); -const utils = __webpack_require__(86444); -const isEmptyString = val => typeof val === 'string' && (val === '' || val === './'); - -/** - * Returns an array of strings that match one or more glob patterns. - * - * ```js - * const mm = require('micromatch'); - * // mm(list, patterns[, options]); - * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {String|Array} list List of strings to match. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} options See available [options](#options) - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ - -const micromatch = (list, patterns, options) => { - patterns = [].concat(patterns); - list = [].concat(list); - - let omit = new Set(); - let keep = new Set(); - let items = new Set(); - let negatives = 0; - - let onResult = state => { - items.add(state.output); - if (options && options.onResult) { - options.onResult(state); - } - }; - - for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); - let negated = isMatch.state.negated || isMatch.state.negatedExtglob; - if (negated) negatives++; - - for (let item of list) { - let matched = isMatch(item, true); - - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) continue; - - if (negated) { - omit.add(matched.output); - } else { - omit.delete(matched.output); - keep.add(matched.output); - } - } - } - - let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter(item => !omit.has(item)); - - if (options && matches.length === 0) { - if (options.failglob === true) { - throw new Error(`No matches found for "${patterns.join(', ')}"`); - } - - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; - } - } - - return matches; -}; - -/** - * Backwards compatibility - */ - -micromatch.match = micromatch; - -/** - * Returns a matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * const mm = require('micromatch'); - * // mm.matcher(pattern[, options]); - * - * const isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` - * @return {Function} Returns a matcher function. - * @api public - */ - -micromatch.matcher = (pattern, options) => picomatch(pattern, options); - -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const mm = require('micromatch'); - * // mm.isMatch(string, patterns[, options]); - * - * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(mm.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); - -/** - * Backwards compatibility - */ - -micromatch.any = micromatch.isMatch; - -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ - -micromatch.not = (list, patterns, options = {}) => { - patterns = [].concat(patterns).map(String); - let result = new Set(); - let items = []; - - let onResult = state => { - if (options.onResult) options.onResult(state); - items.push(state.output); - }; - - let matches = micromatch(list, patterns, { ...options, onResult }); - - for (let item of items) { - if (!matches.includes(item)) { - result.add(item); - } - } - return [...result]; -}; - -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * // mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the patter matches any part of `str`. - * @api public - */ - -micromatch.contains = (str, pattern, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - - if (Array.isArray(pattern)) { - return pattern.some(p => micromatch.contains(str, p, options)); - } - - if (typeof pattern === 'string') { - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } - - if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { - return true; - } - } - - return micromatch.isMatch(str, pattern, { ...options, contains: true }); -}; - -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * const mm = require('micromatch'); - * // mm.matchKeys(object, patterns[, options]); - * - * const obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ - -micromatch.matchKeys = (obj, patterns, options) => { - if (!utils.isObject(obj)) { - throw new TypeError('Expected the first argument to be an object'); - } - let keys = micromatch(Object.keys(obj), patterns, options); - let res = {}; - for (let key of keys) res[key] = obj[key]; - return res; -}; - -/** - * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.some = (list, patterns, options) => { - let items = [].concat(list); - - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (items.some(item => isMatch(item))) { - return true; - } - } - return false; -}; - -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.every = (list, patterns, options) => { - let items = [].concat(list); - - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (!items.every(item => isMatch(item))) { - return false; - } - } - return true; -}; - -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * const mm = require('micromatch'); - * // mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.all = (str, patterns, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - - return [].concat(patterns).every(p => picomatch(p, options)(str)); -}; - -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * const mm = require('micromatch'); - * // mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `glob` Glob pattern to use for matching. - * @param {String} `input` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns an array of captures if the input matches the glob pattern, otherwise `null`. - * @api public - */ - -micromatch.capture = (glob, input, options) => { - let posix = utils.isWindows(options); - let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); - let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); - - if (match) { - return match.slice(1).map(v => v === void 0 ? '' : v); - } -}; - -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * const mm = require('micromatch'); - * // mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ - -micromatch.makeRe = (...args) => picomatch.makeRe(...args); - -/** - * Scan a glob pattern to separate the pattern into segments. Used - * by the [split](#split) method. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.scan(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ - -micromatch.scan = (...args) => picomatch.scan(...args); - -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const mm = require('micromatch'); - * const state = mm(pattern[, options]); - * ``` - * @param {String} `glob` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as regex source string. - * @api public - */ - -micromatch.parse = (patterns, options) => { - let res = []; - for (let pattern of [].concat(patterns || [])) { - for (let str of braces(String(pattern), options)) { - res.push(picomatch.parse(str, options)); - } - } - return res; -}; - -/** - * Process the given brace `pattern`. - * - * ```js - * const { braces } = require('micromatch'); - * console.log(braces('foo/{a,b,c}/bar')); - * //=> [ 'foo/(a|b|c)/bar' ] - * - * console.log(braces('foo/{a,b,c}/bar', { expand: true })); - * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] - * ``` - * @param {String} `pattern` String with brace pattern to process. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ - -micromatch.braces = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { - return [pattern]; - } - return braces(pattern, options); -}; - -/** - * Expand braces - */ - -micromatch.braceExpand = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - return micromatch.braces(pattern, { ...options, expand: true }); -}; - -/** - * Expose micromatch - */ - -module.exports = micromatch; - - -/***/ }), - -/***/ 60123: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirsSync = __webpack_require__(81881).mkdirsSync -const utimesMillisSync = __webpack_require__(64698).utimesMillisSync -const stat = __webpack_require__(66834) - -function copySync (src, dest, opts) { - if (typeof opts === 'function') { - opts = { filter: opts } - } - - opts = opts || {} - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) - } - - const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy') - stat.checkParentPathsSync(src, srcStat, dest, 'copy') - return handleFilterAndCopy(destStat, src, dest, opts) -} - -function handleFilterAndCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - const destParent = path.dirname(dest) - if (!fs.existsSync(destParent)) mkdirsSync(destParent) - return startCopy(destStat, src, dest, opts) -} - -function startCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - return getStats(destStat, src, dest, opts) -} - -function getStats (destStat, src, dest, opts) { - const statSync = opts.dereference ? fs.statSync : fs.lstatSync - const srcStat = statSync(src) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) -} - -function onFile (srcStat, destStat, src, dest, opts) { - if (!destStat) return copyFile(srcStat, src, dest, opts) - return mayCopyFile(srcStat, src, dest, opts) -} - -function mayCopyFile (srcStat, src, dest, opts) { - if (opts.overwrite) { - fs.unlinkSync(dest) - return copyFile(srcStat, src, dest, opts) - } else if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`) - } -} - -function copyFile (srcStat, src, dest, opts) { - fs.copyFileSync(src, dest) - if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) - return setDestMode(dest, srcStat.mode) -} - -function handleTimestamps (srcMode, src, dest) { - // Make sure the file is writable before setting the timestamp - // otherwise open fails with EPERM when invoked with 'r+' - // (through utimes call) - if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) - return setDestTimestamps(src, dest) -} - -function fileIsNotWritable (srcMode) { - return (srcMode & 0o200) === 0 -} - -function makeFileWritable (dest, srcMode) { - return setDestMode(dest, srcMode | 0o200) -} - -function setDestMode (dest, srcMode) { - return fs.chmodSync(dest, srcMode) -} - -function setDestTimestamps (src, dest) { - // The initial srcStat.atime cannot be trusted - // because it is modified by the read(2) system call - // (See https://nodejs.org/api/fs.html#fs_stat_time_values) - const updatedSrcStat = fs.statSync(src) - return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) -} - -function onDir (srcStat, destStat, src, dest, opts) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) - if (destStat && !destStat.isDirectory()) { - throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) - } - return copyDir(src, dest, opts) -} - -function mkDirAndCopy (srcMode, src, dest, opts) { - fs.mkdirSync(dest) - copyDir(src, dest, opts) - return setDestMode(dest, srcMode) -} - -function copyDir (src, dest, opts) { - fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) -} - -function copyDirItem (item, src, dest, opts) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy') - return startCopy(destStat, srcItem, destItem, opts) -} - -function onLink (destStat, src, dest, opts) { - let resolvedSrc = fs.readlinkSync(src) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlinkSync(resolvedSrc, dest) - } else { - let resolvedDest - try { - resolvedDest = fs.readlinkSync(dest) - } catch (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) - throw err - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) - } - - // prevent copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) - } - return copyLink(resolvedSrc, dest) - } -} - -function copyLink (resolvedSrc, dest) { - fs.unlinkSync(dest) - return fs.symlinkSync(resolvedSrc, dest) -} - -module.exports = copySync - - -/***/ }), - -/***/ 6574: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - copySync: __webpack_require__(60123) -} - - -/***/ }), - -/***/ 41132: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirs = __webpack_require__(81881).mkdirs -const pathExists = __webpack_require__(42176).pathExists -const utimesMillis = __webpack_require__(64698).utimesMillis -const stat = __webpack_require__(66834) - -function copy (src, dest, opts, cb) { - if (typeof opts === 'function' && !cb) { - cb = opts - opts = {} - } else if (typeof opts === 'function') { - opts = { filter: opts } - } - - cb = cb || function () {} - opts = opts || {} - - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) - } - - stat.checkPaths(src, dest, 'copy', (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'copy', err => { - if (err) return cb(err) - if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) - return checkParentDir(destStat, src, dest, opts, cb) - }) - }) -} - -function checkParentDir (destStat, src, dest, opts, cb) { - const destParent = path.dirname(dest) - pathExists(destParent, (err, dirExists) => { - if (err) return cb(err) - if (dirExists) return startCopy(destStat, src, dest, opts, cb) - mkdirs(destParent, err => { - if (err) return cb(err) - return startCopy(destStat, src, dest, opts, cb) - }) - }) -} - -function handleFilter (onInclude, destStat, src, dest, opts, cb) { - Promise.resolve(opts.filter(src, dest)).then(include => { - if (include) return onInclude(destStat, src, dest, opts, cb) - return cb() - }, error => cb(error)) -} - -function startCopy (destStat, src, dest, opts, cb) { - if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) - return getStats(destStat, src, dest, opts, cb) -} - -function getStats (destStat, src, dest, opts, cb) { - const stat = opts.dereference ? fs.stat : fs.lstat - stat(src, (err, srcStat) => { - if (err) return cb(err) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) - }) -} - -function onFile (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return copyFile(srcStat, src, dest, opts, cb) - return mayCopyFile(srcStat, src, dest, opts, cb) -} - -function mayCopyFile (srcStat, src, dest, opts, cb) { - if (opts.overwrite) { - fs.unlink(dest, err => { - if (err) return cb(err) - return copyFile(srcStat, src, dest, opts, cb) - }) - } else if (opts.errorOnExist) { - return cb(new Error(`'${dest}' already exists`)) - } else return cb() -} - -function copyFile (srcStat, src, dest, opts, cb) { - fs.copyFile(src, dest, err => { - if (err) return cb(err) - if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb) - return setDestMode(dest, srcStat.mode, cb) - }) -} - -function handleTimestampsAndMode (srcMode, src, dest, cb) { - // Make sure the file is writable before setting the timestamp - // otherwise open fails with EPERM when invoked with 'r+' - // (through utimes call) - if (fileIsNotWritable(srcMode)) { - return makeFileWritable(dest, srcMode, err => { - if (err) return cb(err) - return setDestTimestampsAndMode(srcMode, src, dest, cb) - }) - } - return setDestTimestampsAndMode(srcMode, src, dest, cb) -} - -function fileIsNotWritable (srcMode) { - return (srcMode & 0o200) === 0 -} - -function makeFileWritable (dest, srcMode, cb) { - return setDestMode(dest, srcMode | 0o200, cb) -} - -function setDestTimestampsAndMode (srcMode, src, dest, cb) { - setDestTimestamps(src, dest, err => { - if (err) return cb(err) - return setDestMode(dest, srcMode, cb) - }) -} - -function setDestMode (dest, srcMode, cb) { - return fs.chmod(dest, srcMode, cb) -} - -function setDestTimestamps (src, dest, cb) { - // The initial srcStat.atime cannot be trusted - // because it is modified by the read(2) system call - // (See https://nodejs.org/api/fs.html#fs_stat_time_values) - fs.stat(src, (err, updatedSrcStat) => { - if (err) return cb(err) - return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb) - }) -} - -function onDir (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb) - if (destStat && !destStat.isDirectory()) { - return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) - } - return copyDir(src, dest, opts, cb) -} - -function mkDirAndCopy (srcMode, src, dest, opts, cb) { - fs.mkdir(dest, err => { - if (err) return cb(err) - copyDir(src, dest, opts, err => { - if (err) return cb(err) - return setDestMode(dest, srcMode, cb) - }) - }) -} - -function copyDir (src, dest, opts, cb) { - fs.readdir(src, (err, items) => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) -} - -function copyDirItems (items, src, dest, opts, cb) { - const item = items.pop() - if (!item) return cb() - return copyDirItem(items, item, src, dest, opts, cb) -} - -function copyDirItem (items, item, src, dest, opts, cb) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => { - if (err) return cb(err) - const { destStat } = stats - startCopy(destStat, srcItem, destItem, opts, err => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) - }) -} - -function onLink (destStat, src, dest, opts, cb) { - fs.readlink(src, (err, resolvedSrc) => { - if (err) return cb(err) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlink(resolvedSrc, dest, cb) - } else { - fs.readlink(dest, (err, resolvedDest) => { - if (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) - return cb(err) - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) - } - - // do not copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) - } - return copyLink(resolvedSrc, dest, cb) - }) - } - }) -} - -function copyLink (resolvedSrc, dest, cb) { - fs.unlink(dest, err => { - if (err) return cb(err) - return fs.symlink(resolvedSrc, dest, cb) - }) -} - -module.exports = copy - - -/***/ }), - -/***/ 11647: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -module.exports = { - copy: u(__webpack_require__(41132)) -} - - -/***/ }), - -/***/ 81896: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(81881) -const remove = __webpack_require__(71703) - -const emptyDir = u(function emptyDir (dir, callback) { - callback = callback || function () {} - fs.readdir(dir, (err, items) => { - if (err) return mkdir.mkdirs(dir, callback) - - items = items.map(item => path.join(dir, item)) - - deleteItem() - - function deleteItem () { - const item = items.pop() - if (!item) return callback() - remove.remove(item, err => { - if (err) return callback(err) - deleteItem() - }) - } - }) -}) - -function emptyDirSync (dir) { - let items - try { - items = fs.readdirSync(dir) - } catch { - return mkdir.mkdirsSync(dir) - } - - items.forEach(item => { - item = path.join(dir, item) - remove.removeSync(item) - }) -} - -module.exports = { - emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir, - emptydir: emptyDir -} - - -/***/ }), - -/***/ 6039: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(81881) - -function createFile (file, callback) { - function makeFile () { - fs.writeFile(file, '', err => { - if (err) return callback(err) - callback() - }) - } - - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err - if (!err && stats.isFile()) return callback() - const dir = path.dirname(file) - fs.stat(dir, (err, stats) => { - if (err) { - // if the directory doesn't exist, make it - if (err.code === 'ENOENT') { - return mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeFile() - }) - } - return callback(err) - } - - if (stats.isDirectory()) makeFile() - else { - // parent is not a directory - // This is just to cause an internal ENOTDIR error to be thrown - fs.readdir(dir, err => { - if (err) return callback(err) - }) - } - }) - }) -} - -function createFileSync (file) { - let stats - try { - stats = fs.statSync(file) - } catch {} - if (stats && stats.isFile()) return - - const dir = path.dirname(file) - try { - if (!fs.statSync(dir).isDirectory()) { - // parent is not a directory - // This is just to cause an internal ENOTDIR error to be thrown - fs.readdirSync(dir) - } - } catch (err) { - // If the stat call above failed because the directory doesn't exist, create it - if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir) - else throw err - } - - fs.writeFileSync(file, '') -} - -module.exports = { - createFile: u(createFile), - createFileSync -} - - -/***/ }), - -/***/ 60151: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const file = __webpack_require__(6039) -const link = __webpack_require__(55914) -const symlink = __webpack_require__(98894) - -module.exports = { - // file - createFile: file.createFile, - createFileSync: file.createFileSync, - ensureFile: file.createFile, - ensureFileSync: file.createFileSync, - // link - createLink: link.createLink, - createLinkSync: link.createLinkSync, - ensureLink: link.createLink, - ensureLinkSync: link.createLinkSync, - // symlink - createSymlink: symlink.createSymlink, - createSymlinkSync: symlink.createSymlinkSync, - ensureSymlink: symlink.createSymlink, - ensureSymlinkSync: symlink.createSymlinkSync -} - - -/***/ }), - -/***/ 55914: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(81881) -const pathExists = __webpack_require__(42176).pathExists - -function createLink (srcpath, dstpath, callback) { - function makeLink (srcpath, dstpath) { - fs.link(srcpath, dstpath, err => { - if (err) return callback(err) - callback(null) - }) - } - - pathExists(dstpath, (err, destinationExists) => { - if (err) return callback(err) - if (destinationExists) return callback(null) - fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureLink') - return callback(err) - } - - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return makeLink(srcpath, dstpath) - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeLink(srcpath, dstpath) - }) - }) - }) - }) -} - -function createLinkSync (srcpath, dstpath) { - const destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - try { - fs.lstatSync(srcpath) - } catch (err) { - err.message = err.message.replace('lstat', 'ensureLink') - throw err - } - - const dir = path.dirname(dstpath) - const dirExists = fs.existsSync(dir) - if (dirExists) return fs.linkSync(srcpath, dstpath) - mkdir.mkdirsSync(dir) - - return fs.linkSync(srcpath, dstpath) -} - -module.exports = { - createLink: u(createLink), - createLinkSync -} - - -/***/ }), - -/***/ 68917: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const pathExists = __webpack_require__(42176).pathExists - -/** - * Function that returns two types of paths, one relative to symlink, and one - * relative to the current working directory. Checks if path is absolute or - * relative. If the path is relative, this function checks if the path is - * relative to symlink or relative to current working directory. This is an - * initiative to find a smarter `srcpath` to supply when building symlinks. - * This allows you to determine which path to use out of one of three possible - * types of source paths. The first is an absolute path. This is detected by - * `path.isAbsolute()`. When an absolute path is provided, it is checked to - * see if it exists. If it does it's used, if not an error is returned - * (callback)/ thrown (sync). The other two options for `srcpath` are a - * relative url. By default Node's `fs.symlink` works by creating a symlink - * using `dstpath` and expects the `srcpath` to be relative to the newly - * created symlink. If you provide a `srcpath` that does not exist on the file - * system it results in a broken symlink. To minimize this, the function - * checks to see if the 'relative to symlink' source file exists, and if it - * does it will use it. If it does not, it checks if there's a file that - * exists that is relative to the current working directory, if does its used. - * This preserves the expectations of the original fs.symlink spec and adds - * the ability to pass in `relative to current working direcotry` paths. - */ - -function symlinkPaths (srcpath, dstpath, callback) { - if (path.isAbsolute(srcpath)) { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - toCwd: srcpath, - toDst: srcpath - }) - }) - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - return pathExists(relativeToDst, (err, exists) => { - if (err) return callback(err) - if (exists) { - return callback(null, { - toCwd: relativeToDst, - toDst: srcpath - }) - } else { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - toCwd: srcpath, - toDst: path.relative(dstdir, srcpath) - }) - }) - } - }) - } -} - -function symlinkPathsSync (srcpath, dstpath) { - let exists - if (path.isAbsolute(srcpath)) { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('absolute srcpath does not exist') - return { - toCwd: srcpath, - toDst: srcpath - } - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - exists = fs.existsSync(relativeToDst) - if (exists) { - return { - toCwd: relativeToDst, - toDst: srcpath - } - } else { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('relative srcpath does not exist') - return { - toCwd: srcpath, - toDst: path.relative(dstdir, srcpath) - } - } - } -} - -module.exports = { - symlinkPaths, - symlinkPathsSync -} - - -/***/ }), - -/***/ 19358: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) - -function symlinkType (srcpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - if (type) return callback(null, type) - fs.lstat(srcpath, (err, stats) => { - if (err) return callback(null, 'file') - type = (stats && stats.isDirectory()) ? 'dir' : 'file' - callback(null, type) - }) -} - -function symlinkTypeSync (srcpath, type) { - let stats - - if (type) return type - try { - stats = fs.lstatSync(srcpath) - } catch { - return 'file' - } - return (stats && stats.isDirectory()) ? 'dir' : 'file' -} - -module.exports = { - symlinkType, - symlinkTypeSync -} - - -/***/ }), - -/***/ 98894: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const _mkdirs = __webpack_require__(81881) -const mkdirs = _mkdirs.mkdirs -const mkdirsSync = _mkdirs.mkdirsSync - -const _symlinkPaths = __webpack_require__(68917) -const symlinkPaths = _symlinkPaths.symlinkPaths -const symlinkPathsSync = _symlinkPaths.symlinkPathsSync - -const _symlinkType = __webpack_require__(19358) -const symlinkType = _symlinkType.symlinkType -const symlinkTypeSync = _symlinkType.symlinkTypeSync - -const pathExists = __webpack_require__(42176).pathExists - -function createSymlink (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - pathExists(dstpath, (err, destinationExists) => { - if (err) return callback(err) - if (destinationExists) return callback(null) - symlinkPaths(srcpath, dstpath, (err, relative) => { - if (err) return callback(err) - srcpath = relative.toDst - symlinkType(relative.toCwd, type, (err, type) => { - if (err) return callback(err) - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) - mkdirs(dir, err => { - if (err) return callback(err) - fs.symlink(srcpath, dstpath, type, callback) - }) - }) - }) - }) - }) -} - -function createSymlinkSync (srcpath, dstpath, type) { - const destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - const relative = symlinkPathsSync(srcpath, dstpath) - srcpath = relative.toDst - type = symlinkTypeSync(relative.toCwd, type) - const dir = path.dirname(dstpath) - const exists = fs.existsSync(dir) - if (exists) return fs.symlinkSync(srcpath, dstpath, type) - mkdirsSync(dir) - return fs.symlinkSync(srcpath, dstpath, type) -} - -module.exports = { - createSymlink: u(createSymlink), - createSymlinkSync -} - - -/***/ }), - -/***/ 82998: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -// This is adapted from https://github.com/normalize/mz -// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors -const u = __webpack_require__(92178).fromCallback -const fs = __webpack_require__(82161) - -const api = [ - 'access', - 'appendFile', - 'chmod', - 'chown', - 'close', - 'copyFile', - 'fchmod', - 'fchown', - 'fdatasync', - 'fstat', - 'fsync', - 'ftruncate', - 'futimes', - 'lchmod', - 'lchown', - 'link', - 'lstat', - 'mkdir', - 'mkdtemp', - 'open', - 'opendir', - 'readdir', - 'readFile', - 'readlink', - 'realpath', - 'rename', - 'rmdir', - 'stat', - 'symlink', - 'truncate', - 'unlink', - 'utimes', - 'writeFile' -].filter(key => { - // Some commands are not available on some systems. Ex: - // fs.opendir was added in Node.js v12.12.0 - // fs.lchown is not available on at least some Linux - return typeof fs[key] === 'function' -}) - -// Export all keys: -Object.keys(fs).forEach(key => { - if (key === 'promises') { - // fs.promises is a getter property that triggers ExperimentalWarning - // Don't re-export it here, the getter is defined in "lib/index.js" - return - } - exports[key] = fs[key] -}) - -// Universalify async methods: -api.forEach(method => { - exports[method] = u(fs[method]) -}) - -// We differ from mz/fs in that we still ship the old, broken, fs.exists() -// since we are a drop-in replacement for the native module -exports.exists = function (filename, callback) { - if (typeof callback === 'function') { - return fs.exists(filename, callback) - } - return new Promise(resolve => { - return fs.exists(filename, resolve) - }) -} - -// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args - -exports.read = function (fd, buffer, offset, length, position, callback) { - if (typeof callback === 'function') { - return fs.read(fd, buffer, offset, length, position, callback) - } - return new Promise((resolve, reject) => { - fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { - if (err) return reject(err) - resolve({ bytesRead, buffer }) - }) - }) -} - -// Function signature can be -// fs.write(fd, buffer[, offset[, length[, position]]], callback) -// OR -// fs.write(fd, string[, position[, encoding]], callback) -// We need to handle both cases, so we use ...args -exports.write = function (fd, buffer, ...args) { - if (typeof args[args.length - 1] === 'function') { - return fs.write(fd, buffer, ...args) - } - - return new Promise((resolve, reject) => { - fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { - if (err) return reject(err) - resolve({ bytesWritten, buffer }) - }) - }) -} - -// fs.writev only available in Node v12.9.0+ -if (typeof fs.writev === 'function') { - // Function signature is - // s.writev(fd, buffers[, position], callback) - // We need to handle the optional arg, so we use ...args - exports.writev = function (fd, buffers, ...args) { - if (typeof args[args.length - 1] === 'function') { - return fs.writev(fd, buffers, ...args) - } - - return new Promise((resolve, reject) => { - fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { - if (err) return reject(err) - resolve({ bytesWritten, buffers }) - }) - }) - } -} - -// fs.realpath.native only available in Node v9.2+ -if (typeof fs.realpath.native === 'function') { - exports.realpath.native = u(fs.realpath.native) -} - - -/***/ }), - -/***/ 66272: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - // Export promiseified graceful-fs: - ...__webpack_require__(82998), - // Export extra methods: - ...__webpack_require__(6574), - ...__webpack_require__(11647), - ...__webpack_require__(81896), - ...__webpack_require__(60151), - ...__webpack_require__(16047), - ...__webpack_require__(81881), - ...__webpack_require__(58611), - ...__webpack_require__(96489), - ...__webpack_require__(81192), - ...__webpack_require__(42176), - ...__webpack_require__(71703) -} - -// Export fs.promises as a getter property so that we don't trigger -// ExperimentalWarning before fs.promises is actually accessed. -const fs = __webpack_require__(35747) -if (Object.getOwnPropertyDescriptor(fs, 'promises')) { - Object.defineProperty(module.exports, "promises", ({ - get () { return fs.promises } - })) -} - - -/***/ }), - -/***/ 16047: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromPromise -const jsonFile = __webpack_require__(53118) - -jsonFile.outputJson = u(__webpack_require__(80690)) -jsonFile.outputJsonSync = __webpack_require__(66704) -// aliases -jsonFile.outputJSON = jsonFile.outputJson -jsonFile.outputJSONSync = jsonFile.outputJsonSync -jsonFile.writeJSON = jsonFile.writeJson -jsonFile.writeJSONSync = jsonFile.writeJsonSync -jsonFile.readJSON = jsonFile.readJson -jsonFile.readJSONSync = jsonFile.readJsonSync - -module.exports = jsonFile - - -/***/ }), - -/***/ 53118: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const jsonFile = __webpack_require__(91393) - -module.exports = { - // jsonfile exports - readJson: jsonFile.readFile, - readJsonSync: jsonFile.readFileSync, - writeJson: jsonFile.writeFile, - writeJsonSync: jsonFile.writeFileSync -} - - -/***/ }), - -/***/ 66704: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const { stringify } = __webpack_require__(24401) -const { outputFileSync } = __webpack_require__(81192) - -function outputJsonSync (file, data, options) { - const str = stringify(data, options) - - outputFileSync(file, str, options) -} - -module.exports = outputJsonSync - - -/***/ }), - -/***/ 80690: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const { stringify } = __webpack_require__(24401) -const { outputFile } = __webpack_require__(81192) - -async function outputJson (file, data, options = {}) { - const str = stringify(data, options) - - await outputFile(file, str, options) -} - -module.exports = outputJson - - -/***/ }), - -/***/ 81881: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const u = __webpack_require__(92178).fromPromise -const { makeDir: _makeDir, makeDirSync } = __webpack_require__(970) -const makeDir = u(_makeDir) - -module.exports = { - mkdirs: makeDir, - mkdirsSync: makeDirSync, - // alias - mkdirp: makeDir, - mkdirpSync: makeDirSync, - ensureDir: makeDir, - ensureDirSync: makeDirSync -} - - -/***/ }), - -/***/ 970: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -// Adapted from https://github.com/sindresorhus/make-dir -// Copyright (c) Sindre Sorhus (sindresorhus.com) -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -const fs = __webpack_require__(82998) -const path = __webpack_require__(85622) -const atLeastNode = __webpack_require__(898) - -const useNativeRecursiveOption = atLeastNode('10.12.0') - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')) - - if (pathHasInvalidWinCharacters) { - const error = new Error(`Path contains invalid characters: ${pth}`) - error.code = 'EINVAL' - throw error - } - } -} - -const processOptions = options => { - const defaults = { mode: 0o777 } - if (typeof options === 'number') options = { mode: options } - return { ...defaults, ...options } -} - -const permissionError = pth => { - // This replicates the exception of `fs.mkdir` with native the - // `recusive` option when run on an invalid drive under Windows. - const error = new Error(`operation not permitted, mkdir '${pth}'`) - error.code = 'EPERM' - error.errno = -4048 - error.path = pth - error.syscall = 'mkdir' - return error -} - -module.exports.makeDir = async (input, options) => { - checkPath(input) - options = processOptions(options) - - if (useNativeRecursiveOption) { - const pth = path.resolve(input) - - return fs.mkdir(pth, { - mode: options.mode, - recursive: true - }) - } - - const make = async pth => { - try { - await fs.mkdir(pth, options.mode) - } catch (error) { - if (error.code === 'EPERM') { - throw error - } - - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth) - } - - if (error.message.includes('null bytes')) { - throw error - } - - await make(path.dirname(pth)) - return make(pth) - } - - try { - const stats = await fs.stat(pth) - if (!stats.isDirectory()) { - // This error is never exposed to the user - // it is caught below, and the original error is thrown - throw new Error('The path is not a directory') - } - } catch { - throw error - } - } - } - - return make(path.resolve(input)) -} - -module.exports.makeDirSync = (input, options) => { - checkPath(input) - options = processOptions(options) - - if (useNativeRecursiveOption) { - const pth = path.resolve(input) - - return fs.mkdirSync(pth, { - mode: options.mode, - recursive: true - }) - } - - const make = pth => { - try { - fs.mkdirSync(pth, options.mode) - } catch (error) { - if (error.code === 'EPERM') { - throw error - } - - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth) - } - - if (error.message.includes('null bytes')) { - throw error - } - - make(path.dirname(pth)) - return make(pth) - } - - try { - if (!fs.statSync(pth).isDirectory()) { - // This error is never exposed to the user - // it is caught below, and the original error is thrown - throw new Error('The path is not a directory') - } - } catch { - throw error - } - } - } - - return make(path.resolve(input)) -} - - -/***/ }), - -/***/ 58611: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - moveSync: __webpack_require__(18178) -} - - -/***/ }), - -/***/ 18178: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copySync = __webpack_require__(6574).copySync -const removeSync = __webpack_require__(71703).removeSync -const mkdirpSync = __webpack_require__(81881).mkdirpSync -const stat = __webpack_require__(66834) - -function moveSync (src, dest, opts) { - opts = opts || {} - const overwrite = opts.overwrite || opts.clobber || false - - const { srcStat } = stat.checkPathsSync(src, dest, 'move') - stat.checkParentPathsSync(src, srcStat, dest, 'move') - mkdirpSync(path.dirname(dest)) - return doRename(src, dest, overwrite) -} - -function doRename (src, dest, overwrite) { - if (overwrite) { - removeSync(dest) - return rename(src, dest, overwrite) - } - if (fs.existsSync(dest)) throw new Error('dest already exists.') - return rename(src, dest, overwrite) -} - -function rename (src, dest, overwrite) { - try { - fs.renameSync(src, dest) - } catch (err) { - if (err.code !== 'EXDEV') throw err - return moveAcrossDevice(src, dest, overwrite) - } -} - -function moveAcrossDevice (src, dest, overwrite) { - const opts = { - overwrite, - errorOnExist: true - } - copySync(src, dest, opts) - return removeSync(src) -} - -module.exports = moveSync - - -/***/ }), - -/***/ 96489: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -module.exports = { - move: u(__webpack_require__(71294)) -} - - -/***/ }), - -/***/ 71294: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copy = __webpack_require__(11647).copy -const remove = __webpack_require__(71703).remove -const mkdirp = __webpack_require__(81881).mkdirp -const pathExists = __webpack_require__(42176).pathExists -const stat = __webpack_require__(66834) - -function move (src, dest, opts, cb) { - if (typeof opts === 'function') { - cb = opts - opts = {} - } - - const overwrite = opts.overwrite || opts.clobber || false - - stat.checkPaths(src, dest, 'move', (err, stats) => { - if (err) return cb(err) - const { srcStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'move', err => { - if (err) return cb(err) - mkdirp(path.dirname(dest), err => { - if (err) return cb(err) - return doRename(src, dest, overwrite, cb) - }) - }) - }) -} - -function doRename (src, dest, overwrite, cb) { - if (overwrite) { - return remove(dest, err => { - if (err) return cb(err) - return rename(src, dest, overwrite, cb) - }) - } - pathExists(dest, (err, destExists) => { - if (err) return cb(err) - if (destExists) return cb(new Error('dest already exists.')) - return rename(src, dest, overwrite, cb) - }) -} - -function rename (src, dest, overwrite, cb) { - fs.rename(src, dest, err => { - if (!err) return cb() - if (err.code !== 'EXDEV') return cb(err) - return moveAcrossDevice(src, dest, overwrite, cb) - }) -} - -function moveAcrossDevice (src, dest, overwrite, cb) { - const opts = { - overwrite, - errorOnExist: true - } - copy(src, dest, opts, err => { - if (err) return cb(err) - return remove(src, cb) - }) -} - -module.exports = move - - -/***/ }), - -/***/ 81192: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(81881) -const pathExists = __webpack_require__(42176).pathExists - -function outputFile (file, data, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding - encoding = 'utf8' - } - - const dir = path.dirname(file) - pathExists(dir, (err, itDoes) => { - if (err) return callback(err) - if (itDoes) return fs.writeFile(file, data, encoding, callback) - - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - - fs.writeFile(file, data, encoding, callback) - }) - }) -} - -function outputFileSync (file, ...args) { - const dir = path.dirname(file) - if (fs.existsSync(dir)) { - return fs.writeFileSync(file, ...args) - } - mkdir.mkdirsSync(dir) - fs.writeFileSync(file, ...args) -} - -module.exports = { - outputFile: u(outputFile), - outputFileSync -} - - -/***/ }), - -/***/ 42176: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const u = __webpack_require__(92178).fromPromise -const fs = __webpack_require__(82998) - -function pathExists (path) { - return fs.access(path).then(() => true).catch(() => false) -} - -module.exports = { - pathExists: u(pathExists), - pathExistsSync: fs.existsSync -} - - -/***/ }), - -/***/ 71703: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(92178).fromCallback -const rimraf = __webpack_require__(90065) - -module.exports = { - remove: u(rimraf), - removeSync: rimraf.sync -} - - -/***/ }), - -/***/ 90065: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const assert = __webpack_require__(42357) - -const isWindows = (process.platform === 'win32') - -function defaults (options) { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 -} - -function rimraf (p, options, cb) { - let busyTries = 0 - - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - rimraf_(p, options, function CB (er) { - if (er) { - if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && - busyTries < options.maxBusyTries) { - busyTries++ - const time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), time) - } - - // already gone - if (er.code === 'ENOENT') er = null - } - - cb(er) - }) -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === 'ENOENT') { - return cb(null) - } - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === 'EPERM' && isWindows) { - return fixWinEPERM(p, options, er, cb) - } - - if (st && st.isDirectory()) { - return rmdir(p, options, er, cb) - } - - options.unlink(p, er => { - if (er) { - if (er.code === 'ENOENT') { - return cb(null) - } - if (er.code === 'EPERM') { - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - } - if (er.code === 'EISDIR') { - return rmdir(p, options, er, cb) - } - } - return cb(er) - }) - }) -} - -function fixWinEPERM (p, options, er, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) { - cb(er2.code === 'ENOENT' ? null : er) - } else { - options.stat(p, (er3, stats) => { - if (er3) { - cb(er3.code === 'ENOENT' ? null : er) - } else if (stats.isDirectory()) { - rmdir(p, options, er, cb) - } else { - options.unlink(p, cb) - } - }) - } - }) -} - -function fixWinEPERMSync (p, options, er) { - let stats - - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === 'ENOENT') { - return - } else { - throw er - } - } - - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === 'ENOENT') { - return - } else { - throw er - } - } - - if (stats.isDirectory()) { - rmdirSync(p, options, er) - } else { - options.unlinkSync(p) - } -} - -function rmdir (p, options, originalEr, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { - rmkids(p, options, cb) - } else if (er && er.code === 'ENOTDIR') { - cb(originalEr) - } else { - cb(er) - } - }) -} - -function rmkids (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) return cb(er) - - let n = files.length - let errState - - if (n === 0) return options.rmdir(p, cb) - - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) { - return - } - if (er) return cb(errState = er) - if (--n === 0) { - options.rmdir(p, cb) - } - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -function rimrafSync (p, options) { - let st - - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === 'ENOENT') { - return - } - - // Windows can EPERM on stat. Life is suffering. - if (er.code === 'EPERM' && isWindows) { - fixWinEPERMSync(p, options, er) - } - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) { - rmdirSync(p, options, null) - } else { - options.unlinkSync(p) - } - } catch (er) { - if (er.code === 'ENOENT') { - return - } else if (er.code === 'EPERM') { - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - } else if (er.code !== 'EISDIR') { - throw er - } - rmdirSync(p, options, er) - } -} - -function rmdirSync (p, options, originalEr) { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === 'ENOTDIR') { - throw originalEr - } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { - rmkidsSync(p, options) - } else if (er.code !== 'ENOENT') { - throw er - } - } -} - -function rmkidsSync (p, options) { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - if (isWindows) { - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const startTime = Date.now() - do { - try { - const ret = options.rmdirSync(p, options) - return ret - } catch {} - } while (Date.now() - startTime < 500) // give up after 500ms - } else { - const ret = options.rmdirSync(p, options) - return ret - } -} - -module.exports = rimraf -rimraf.sync = rimrafSync - - -/***/ }), - -/***/ 66834: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82998) -const path = __webpack_require__(85622) -const util = __webpack_require__(31669) -const atLeastNode = __webpack_require__(898) - -const nodeSupportsBigInt = atLeastNode('10.5.0') -const stat = (file) => nodeSupportsBigInt ? fs.stat(file, { bigint: true }) : fs.stat(file) -const statSync = (file) => nodeSupportsBigInt ? fs.statSync(file, { bigint: true }) : fs.statSync(file) - -function getStats (src, dest) { - return Promise.all([ - stat(src), - stat(dest).catch(err => { - if (err.code === 'ENOENT') return null - throw err - }) - ]).then(([srcStat, destStat]) => ({ srcStat, destStat })) -} - -function getStatsSync (src, dest) { - let destStat - const srcStat = statSync(src) - try { - destStat = statSync(dest) - } catch (err) { - if (err.code === 'ENOENT') return { srcStat, destStat: null } - throw err - } - return { srcStat, destStat } -} - -function checkPaths (src, dest, funcName, cb) { - util.callbackify(getStats)(src, dest, (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - if (destStat && areIdentical(srcStat, destStat)) { - return cb(new Error('Source and destination must not be the same.')) - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return cb(null, { srcStat, destStat }) - }) -} - -function checkPathsSync (src, dest, funcName) { - const { srcStat, destStat } = getStatsSync(src, dest) - if (destStat && areIdentical(srcStat, destStat)) { - throw new Error('Source and destination must not be the same.') - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - throw new Error(errMsg(src, dest, funcName)) - } - return { srcStat, destStat } -} - -// recursively check if dest parent is a subdirectory of src. -// It works for all file types including symlinks since it -// checks the src and dest inodes. It starts from the deepest -// parent and stops once it reaches the src parent or the root path. -function checkParentPaths (src, srcStat, dest, funcName, cb) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() - const callback = (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb() - return cb(err) - } - if (areIdentical(srcStat, destStat)) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return checkParentPaths(src, srcStat, destParent, funcName, cb) - } - if (nodeSupportsBigInt) fs.stat(destParent, { bigint: true }, callback) - else fs.stat(destParent, callback) -} - -function checkParentPathsSync (src, srcStat, dest, funcName) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return - let destStat - try { - destStat = statSync(destParent) - } catch (err) { - if (err.code === 'ENOENT') return - throw err - } - if (areIdentical(srcStat, destStat)) { - throw new Error(errMsg(src, dest, funcName)) - } - return checkParentPathsSync(src, srcStat, destParent, funcName) -} - -function areIdentical (srcStat, destStat) { - if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) { - // definitive answer - return true - } - // Use additional heuristics if we can't use 'bigint'. - // Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER - // See issue 657 - if (destStat.size === srcStat.size && - destStat.mode === srcStat.mode && - destStat.nlink === srcStat.nlink && - destStat.atimeMs === srcStat.atimeMs && - destStat.mtimeMs === srcStat.mtimeMs && - destStat.ctimeMs === srcStat.ctimeMs && - destStat.birthtimeMs === srcStat.birthtimeMs) { - // heuristic answer - return true - } - } - return false -} - -// return true if dest is a subdir of src, otherwise false. -// It only checks the path strings. -function isSrcSubdir (src, dest) { - const srcArr = path.resolve(src).split(path.sep).filter(i => i) - const destArr = path.resolve(dest).split(path.sep).filter(i => i) - return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) -} - -function errMsg (src, dest, funcName) { - return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` -} - -module.exports = { - checkPaths, - checkPathsSync, - checkParentPaths, - checkParentPathsSync, - isSrcSubdir -} - - -/***/ }), - -/***/ 64698: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) - -function utimesMillis (path, atime, mtime, callback) { - // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) - fs.open(path, 'r+', (err, fd) => { - if (err) return callback(err) - fs.futimes(fd, atime, mtime, futimesErr => { - fs.close(fd, closeErr => { - if (callback) callback(futimesErr || closeErr) - }) - }) - }) -} - -function utimesMillisSync (path, atime, mtime) { - const fd = fs.openSync(path, 'r+') - fs.futimesSync(fd, atime, mtime) - return fs.closeSync(fd) -} - -module.exports = { - utimesMillis, - utimesMillisSync -} - - -/***/ }), - -/***/ 54082: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch - -var fs = __webpack_require__(35747) -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(42145) - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} - -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } - - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } - } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} - - -/***/ }), - -/***/ 42145: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var pathModule = __webpack_require__(85622); -var isWindows = process.platform === 'win32'; -var fs = __webpack_require__(35747); - -// JavaScript implementation of realpath, ported from node pre-v6 - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; - - return callback; - - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; - - -/***/ }), - -/***/ 5882: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const {PassThrough: PassThroughStream} = __webpack_require__(92413); - -module.exports = options => { - options = {...options}; - - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } - - if (isBuffer) { - encoding = null; - } - - const stream = new PassThroughStream({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - let length = 0; - const chunks = []; - - stream.on('data', chunk => { - chunks.push(chunk); - - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return chunks; - } - - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; - - stream.getBufferedLength = () => length; - - return stream; -}; - - -/***/ }), - -/***/ 63886: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const pump = __webpack_require__(20113); -const bufferStream = __webpack_require__(5882); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -async function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - options = { - maxBuffer: Infinity, - ...options - }; - - const {maxBuffer} = options; - - let stream; - await new Promise((resolve, reject) => { - const rejectPromise = error => { - if (error) { // A null check - error.bufferedData = stream.getBufferedValue(); - } - - reject(error); - }; - - stream = pump(inputStream, bufferStream(options), error => { - if (error) { - rejectPromise(error); - return; - } - - resolve(); - }); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - - return stream.getBufferedValue(); -} - -module.exports = getStream; -// TODO: Remove this for the next major release -module.exports.default = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; - - -/***/ }), - -/***/ 20429: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -const cp = __webpack_require__(63129); -const fs = __webpack_require__(35296); -const path = __webpack_require__(85622); -const util = __webpack_require__(31669); - -/** - * @constructor - * @param {number} code Error code. - * @param {string} message Error message. - */ -function ProcessError(code, message) { - const callee = arguments.callee; - Error.apply(this, [message]); - Error.captureStackTrace(this, callee); - this.code = code; - this.message = message; - this.name = callee.name; -} -util.inherits(ProcessError, Error); - -/** - * Util function for handling spawned processes as promises. - * @param {string} exe Executable. - * @param {Array.} args Arguments. - * @param {string} cwd Working directory. - * @return {Promise} A promise. - */ -function spawn(exe, args, cwd) { - return new Promise((resolve, reject) => { - const child = cp.spawn(exe, args, {cwd: cwd || process.cwd()}); - const buffer = []; - child.stderr.on('data', chunk => { - buffer.push(chunk.toString()); - }); - child.stdout.on('data', chunk => { - buffer.push(chunk.toString()); - }); - child.on('close', code => { - const output = buffer.join(''); - if (code) { - const msg = output || 'Process failed: ' + code; - reject(new ProcessError(code, msg)); - } else { - resolve(output); - } - }); - }); -} - -/** - * Create an object for executing git commands. - * @param {string} cwd Repository directory. - * @param {string} exe Git executable (full path if not already on path). - * @constructor - */ -function Git(cwd, cmd) { - this.cwd = cwd; - this.cmd = cmd || 'git'; - this.output = ''; -} - -/** - * Execute an arbitrary git command. - * @param {string} var_args Arguments (e.g. 'remote', 'update'). - * @return {Promise} A promise. The promise will be resolved with this instance - * or rejected with an error. - */ -Git.prototype.exec = function() { - return spawn(this.cmd, [...arguments], this.cwd).then(output => { - this.output = output; - return this; - }); -}; - -/** - * Initialize repository. - * @return {Promise} A promise. - */ -Git.prototype.init = function() { - return this.exec('init'); -}; - -/** - * Clean up unversioned files. - * @return {Promise} A promise. - */ -Git.prototype.clean = function() { - return this.exec('clean', '-f', '-d'); -}; - -/** - * Hard reset to remote/branch - * @param {string} remote Remote alias. - * @param {string} branch Branch name. - * @return {Promise} A promise. - */ -Git.prototype.reset = function(remote, branch) { - return this.exec('reset', '--hard', remote + '/' + branch); -}; - -/** - * Fetch from a remote. - * @param {string} remote Remote alias. - * @return {Promise} A promise. - */ -Git.prototype.fetch = function(remote) { - return this.exec('fetch', remote); -}; - -/** - * Checkout a branch (create an orphan if it doesn't exist on the remote). - * @param {string} remote Remote alias. - * @param {string} branch Branch name. - * @return {Promise} A promise. - */ -Git.prototype.checkout = function(remote, branch) { - const treeish = remote + '/' + branch; - return this.exec('ls-remote', '--exit-code', '.', treeish).then( - () => { - // branch exists on remote, hard reset - return this.exec('checkout', branch) - .then(() => this.clean()) - .then(() => this.reset(remote, branch)); - }, - error => { - if (error instanceof ProcessError && error.code === 2) { - // branch doesn't exist, create an orphan - return this.exec('checkout', '--orphan', branch); - } else { - // unhandled error - throw error; - } - } - ); -}; - -/** - * Remove all unversioned files. - * @param {string|string[]} files Files argument. - * @return {Promise} A promise. - */ -Git.prototype.rm = function(files) { - if (!Array.isArray(files)) { - files = [files]; - } - return this.exec('rm', '--ignore-unmatch', '-r', '-f', ...files); -}; - -/** - * Add files. - * @param {string|string[]} files Files argument. - * @return {Promise} A promise. - */ -Git.prototype.add = function(files) { - if (!Array.isArray(files)) { - files = [files]; - } - return this.exec('add', ...files); -}; - -/** - * Commit (if there are any changes). - * @param {string} message Commit message. - * @return {Promise} A promise. - */ -Git.prototype.commit = function(message) { - return this.exec('diff-index', '--quiet', 'HEAD').catch(() => - this.exec('commit', '-m', message) - ); -}; - -/** - * Add tag - * @param {string} name Name of tag. - * @return {Promise} A promise. - */ -Git.prototype.tag = function(name) { - return this.exec('tag', name); -}; - -/** - * Push a branch. - * @param {string} remote Remote alias. - * @param {string} branch Branch name. - * @param {boolean} force Force push. - * @return {Promise} A promise. - */ -Git.prototype.push = function(remote, branch, force) { - const args = ['push', '--tags', remote, branch]; - if (force) { - args.push('--force'); - } - return this.exec.apply(this, args); -}; - -/** - * Get the URL for a remote. - * @param {string} remote Remote alias. - * @return {Promise} A promise for the remote URL. - */ -Git.prototype.getRemoteUrl = function(remote) { - return this.exec('config', '--get', 'remote.' + remote + '.url') - .then(git => { - const repo = git.output && git.output.split(/[\n\r]/).shift(); - if (repo) { - return repo; - } else { - throw new Error( - 'Failed to get repo URL from options or current directory.' - ); - } - }) - .catch(err => { - throw new Error( - 'Failed to get remote.' + - remote + - '.url (task must either be ' + - 'run in a git repository with a configured ' + - remote + - ' remote ' + - 'or must be configured with the "repo" option).' - ); - }); -}; - -/** - * Delete ref to remove branch history - * @param {string} branch - */ -Git.prototype.deleteRef = function(branch) { - return this.exec('update-ref', '-d', 'refs/heads/' + branch); -}; - -/** - * Clone a repo into the given dir if it doesn't already exist. - * @param {string} repo Repository URL. - * @param {string} dir Target directory. - * @param {string} branch Branch name. - * @param {options} options All options. - * @return {Promise} A promise. - */ -Git.clone = function clone(repo, dir, branch, options) { - return fs.exists(dir).then(exists => { - if (exists) { - return Promise.resolve(new Git(dir, options.git)); - } else { - return fs.mkdirp(path.dirname(path.resolve(dir))).then(() => { - const args = [ - 'clone', - repo, - dir, - '--branch', - branch, - '--single-branch', - '--origin', - options.remote, - '--depth', - options.depth - ]; - return spawn(options.git, args) - .catch(err => { - // try again without branch or depth options - return spawn(options.git, [ - 'clone', - repo, - dir, - '--origin', - options.remote - ]); - }) - .then(() => new Git(dir, options.git)); - }); - } - }); -}; - -module.exports = Git; - - -/***/ }), - -/***/ 56179: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -const findCacheDir = __webpack_require__(1351); -const Git = __webpack_require__(20429); -const filenamify = __webpack_require__(63088); -const copy = __webpack_require__(70160)/* .copy */ .JG; -const getUser = __webpack_require__(70160)/* .getUser */ .PR; -const fs = __webpack_require__(35296); -const globby = __webpack_require__(97375); -const path = __webpack_require__(85622); -const util = __webpack_require__(31669); - -const log = util.debuglog('gh-pages'); - -function getCacheDir() { - return findCacheDir({name: 'gh-pages'}); -} - -function getRepo(options) { - if (options.repo) { - return Promise.resolve(options.repo); - } else { - const git = new Git(process.cwd(), options.git); - return git.getRemoteUrl(options.remote); - } -} - -exports.defaults = { - dest: '.', - add: false, - git: 'git', - depth: 1, - dotfiles: false, - branch: 'gh-pages', - remote: 'origin', - src: '**/*', - remove: '.', - push: true, - history: true, - message: 'Updates', - silent: false -}; - -/** - * Push a git branch to a remote (pushes gh-pages by default). - * @param {string} basePath The base path. - * @param {Object} config Publish options. - * @param {Function} callback Callback. - */ -exports.publish = function publish(basePath, config, callback) { - if (typeof config === 'function') { - callback = config; - config = {}; - } - - const options = Object.assign({}, exports.defaults, config); - - // For backward compatibility before fixing #334 - if (options.only) { - options.remove = options.only; - } - - if (!callback) { - callback = function(err) { - if (err) { - log(err.message); - } - }; - } - - function done(err) { - try { - callback(err); - } catch (err2) { - log('Publish callback threw: %s', err2.message); - } - } - - try { - if (!fs.statSync(basePath).isDirectory()) { - done(new Error('The "base" option must be an existing directory')); - return; - } - } catch (err) { - done(err); - return; - } - - const files = globby - .sync(options.src, { - cwd: basePath, - dot: options.dotfiles - }) - .filter(file => { - return !fs.statSync(path.join(basePath, file)).isDirectory(); - }); - - if (!Array.isArray(files) || files.length === 0) { - done( - new Error('The pattern in the "src" property didn\'t match any files.') - ); - return; - } - - let repoUrl; - let userPromise; - if (options.user) { - userPromise = Promise.resolve(options.user); - } else { - userPromise = getUser(); - } - return userPromise.then(user => - getRepo(options) - .then(repo => { - repoUrl = repo; - const clone = path.join(getCacheDir(), filenamify(repo)); - log('Cloning %s into %s', repo, clone); - return Git.clone(repo, clone, options.branch, options); - }) - .then(git => { - return git.getRemoteUrl(options.remote).then(url => { - if (url !== repoUrl) { - const message = - 'Remote url mismatch. Got "' + - url + - '" ' + - 'but expected "' + - repoUrl + - '" in ' + - git.cwd + - '. Try running the `gh-pages-clean` script first.'; - throw new Error(message); - } - return git; - }); - }) - .then(git => { - // only required if someone mucks with the checkout between builds - log('Cleaning'); - return git.clean(); - }) - .then(git => { - log('Fetching %s', options.remote); - return git.fetch(options.remote); - }) - .then(git => { - log('Checking out %s/%s ', options.remote, options.branch); - return git.checkout(options.remote, options.branch); - }) - .then(git => { - if (!options.history) { - return git.deleteRef(options.branch); - } else { - return git; - } - }) - .then(git => { - if (options.add) { - return git; - } - - log('Removing files'); - const files = globby - .sync(options.remove, { - cwd: path.join(git.cwd, options.dest) - }) - .map(file => path.join(options.dest, file)); - if (files.length > 0) { - return git.rm(files); - } else { - return git; - } - }) - .then(git => { - log('Copying files'); - return copy(files, basePath, path.join(git.cwd, options.dest)).then( - function() { - return git; - } - ); - }) - .then(git => { - return Promise.resolve( - options.beforeAdd && options.beforeAdd(git) - ).then(() => git); - }) - .then(git => { - log('Adding all'); - return git.add('.'); - }) - .then(git => { - if (!user) { - return git; - } - return git.exec('config', 'user.email', user.email).then(() => { - if (!user.name) { - return git; - } - return git.exec('config', 'user.name', user.name); - }); - }) - .then(git => { - log('Committing'); - return git.commit(options.message); - }) - .then(git => { - if (options.tag) { - log('Tagging'); - return git.tag(options.tag).catch(error => { - // tagging failed probably because this tag alredy exists - log(error); - log('Tagging failed, continuing'); - return git; - }); - } else { - return git; - } - }) - .then(git => { - if (options.push) { - log('Pushing'); - return git.push(options.remote, options.branch, !options.history); - } else { - return git; - } - }) - .then( - () => done(), - error => { - if (options.silent) { - error = new Error( - 'Unspecified error (run without silent option for detail)' - ); - } - done(error); - } - ) - ); -}; - -/** - * Clean the cache directory. - */ -exports.clean = function clean() { - fs.removeSync(getCacheDir()); -}; - - -/***/ }), - -/***/ 70160: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -var __webpack_unused_export__; -const path = __webpack_require__(85622); -const Git = __webpack_require__(20429); -const async = __webpack_require__(84653); -const fs = __webpack_require__(35296); - -/** - * Generate a list of unique directory paths given a list of file paths. - * @param {Array.} files List of file paths. - * @return {Array.} List of directory paths. - */ -const uniqueDirs = (__webpack_unused_export__ = function(files) { - const dirs = {}; - files.forEach(filepath => { - const parts = path.dirname(filepath).split(path.sep); - let partial = parts[0] || '/'; - dirs[partial] = true; - for (let i = 1, ii = parts.length; i < ii; ++i) { - partial = path.join(partial, parts[i]); - dirs[partial] = true; - } - }); - return Object.keys(dirs); -}); - -/** - * Sort function for paths. Sorter paths come first. Paths of equal length are - * sorted alphanumerically in path segment order. - * @param {string} a First path. - * @param {string} b Second path. - * @return {number} Comparison. - */ -const byShortPath = (__webpack_unused_export__ = (a, b) => { - const aParts = a.split(path.sep); - const bParts = b.split(path.sep); - const aLength = aParts.length; - const bLength = bParts.length; - let cmp = 0; - if (aLength < bLength) { - cmp = -1; - } else if (aLength > bLength) { - cmp = 1; - } else { - let aPart, bPart; - for (let i = 0; i < aLength; ++i) { - aPart = aParts[i]; - bPart = bParts[i]; - if (aPart < bPart) { - cmp = -1; - break; - } else if (aPart > bPart) { - cmp = 1; - break; - } - } - } - return cmp; -}); - -/** - * Generate a list of directories to create given a list of file paths. - * @param {Array.} files List of file paths. - * @return {Array.} List of directory paths ordered by path length. - */ -const dirsToCreate = (__webpack_unused_export__ = function(files) { - return uniqueDirs(files).sort(byShortPath); -}); - -/** - * Copy a file. - * @param {Object} obj Object with src and dest properties. - * @param {function(Error)} callback Callback - */ -const copyFile = (__webpack_unused_export__ = function(obj, callback) { - let called = false; - function done(err) { - if (!called) { - called = true; - callback(err); - } - } - - const read = fs.createReadStream(obj.src); - read.on('error', err => { - done(err); - }); - - const write = fs.createWriteStream(obj.dest); - write.on('error', err => { - done(err); - }); - write.on('close', () => { - done(); - }); - - read.pipe(write); -}); - -/** - * Make directory, ignoring errors if directory already exists. - * @param {string} path Directory path. - * @param {function(Error)} callback Callback. - */ -function makeDir(path, callback) { - fs.mkdir(path, err => { - if (err) { - // check if directory exists - fs.stat(path, (err2, stat) => { - if (err2 || !stat.isDirectory()) { - callback(err); - } else { - callback(); - } - }); - } else { - callback(); - } - }); -} - -/** - * Copy a list of files. - * @param {Array.} files Files to copy. - * @param {string} base Base directory. - * @param {string} dest Destination directory. - * @return {Promise} A promise. - */ -exports.JG = function(files, base, dest) { - return new Promise((resolve, reject) => { - const pairs = []; - const destFiles = []; - files.forEach(file => { - const src = path.resolve(base, file); - const relative = path.relative(base, src); - const target = path.join(dest, relative); - pairs.push({ - src: src, - dest: target - }); - destFiles.push(target); - }); - - async.eachSeries(dirsToCreate(destFiles), makeDir, err => { - if (err) { - return reject(err); - } - async.each(pairs, copyFile, err => { - if (err) { - return reject(err); - } else { - return resolve(); - } - }); - }); - }); -}; - -exports.PR = function(cwd) { - return Promise.all([ - new Git(cwd).exec('config', 'user.name'), - new Git(cwd).exec('config', 'user.email') - ]) - .then(results => { - return {name: results[0].output.trim(), email: results[1].output.trim()}; - }) - .catch(err => { - // git config exits with 1 if name or email is not set - return null; - }); -}; - - -/***/ }), - -/***/ 39849: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var arrayUniq = __webpack_require__(52357); - -module.exports = function () { - return arrayUniq([].concat.apply([], arguments)); -}; - - -/***/ }), - -/***/ 1351: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const commonDir = __webpack_require__(28192); -const pkgDir = __webpack_require__(8989); -const makeDir = __webpack_require__(90293); - -const {env, cwd} = process; - -const isWritable = path => { - try { - fs.accessSync(path, fs.constants.W_OK); - return true; - } catch (_) { - return false; - } -}; - -function useDirectory(directory, options) { - if (options.create) { - makeDir.sync(directory); - } - - if (options.thunk) { - return (...arguments_) => path.join(directory, ...arguments_); - } - - return directory; -} - -function getNodeModuleDirectory(directory) { - const nodeModules = path.join(directory, 'node_modules'); - - if ( - !isWritable(nodeModules) && - (fs.existsSync(nodeModules) || !isWritable(path.join(directory))) - ) { - return; - } - - return nodeModules; -} - -module.exports = (options = {}) => { - if (env.CACHE_DIR && !['true', 'false', '1', '0'].includes(env.CACHE_DIR)) { - return useDirectory(path.join(env.CACHE_DIR, 'find-cache-dir'), options); - } - - let {cwd: directory = cwd()} = options; - - if (options.files) { - directory = commonDir(directory, options.files); - } - - directory = pkgDir.sync(directory); - - if (!directory) { - return; - } - - const nodeModules = getNodeModuleDirectory(directory); - if (!nodeModules) { - return undefined; - } - - return useDirectory(path.join(directory, 'node_modules', '.cache', options.name), options); -}; - - -/***/ }), - -/***/ 72574: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirpSync = __webpack_require__(89715).mkdirsSync -const utimesSync = __webpack_require__(20629).utimesMillisSync -const stat = __webpack_require__(68755) - -function copySync (src, dest, opts) { - if (typeof opts === 'function') { - opts = { filter: opts } - } - - opts = opts || {} - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) - } - - const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy') - stat.checkParentPathsSync(src, srcStat, dest, 'copy') - return handleFilterAndCopy(destStat, src, dest, opts) -} - -function handleFilterAndCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - const destParent = path.dirname(dest) - if (!fs.existsSync(destParent)) mkdirpSync(destParent) - return startCopy(destStat, src, dest, opts) -} - -function startCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - return getStats(destStat, src, dest, opts) -} - -function getStats (destStat, src, dest, opts) { - const statSync = opts.dereference ? fs.statSync : fs.lstatSync - const srcStat = statSync(src) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) -} - -function onFile (srcStat, destStat, src, dest, opts) { - if (!destStat) return copyFile(srcStat, src, dest, opts) - return mayCopyFile(srcStat, src, dest, opts) -} - -function mayCopyFile (srcStat, src, dest, opts) { - if (opts.overwrite) { - fs.unlinkSync(dest) - return copyFile(srcStat, src, dest, opts) - } else if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`) - } -} - -function copyFile (srcStat, src, dest, opts) { - if (typeof fs.copyFileSync === 'function') { - fs.copyFileSync(src, dest) - fs.chmodSync(dest, srcStat.mode) - if (opts.preserveTimestamps) { - return utimesSync(dest, srcStat.atime, srcStat.mtime) - } - return - } - return copyFileFallback(srcStat, src, dest, opts) -} - -function copyFileFallback (srcStat, src, dest, opts) { - const BUF_LENGTH = 64 * 1024 - const _buff = __webpack_require__(57981)(BUF_LENGTH) - - const fdr = fs.openSync(src, 'r') - const fdw = fs.openSync(dest, 'w', srcStat.mode) - let pos = 0 - - while (pos < srcStat.size) { - const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) - fs.writeSync(fdw, _buff, 0, bytesRead) - pos += bytesRead - } - - if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime) - - fs.closeSync(fdr) - fs.closeSync(fdw) -} - -function onDir (srcStat, destStat, src, dest, opts) { - if (!destStat) return mkDirAndCopy(srcStat, src, dest, opts) - if (destStat && !destStat.isDirectory()) { - throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) - } - return copyDir(src, dest, opts) -} - -function mkDirAndCopy (srcStat, src, dest, opts) { - fs.mkdirSync(dest) - copyDir(src, dest, opts) - return fs.chmodSync(dest, srcStat.mode) -} - -function copyDir (src, dest, opts) { - fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) -} - -function copyDirItem (item, src, dest, opts) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy') - return startCopy(destStat, srcItem, destItem, opts) -} - -function onLink (destStat, src, dest, opts) { - let resolvedSrc = fs.readlinkSync(src) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlinkSync(resolvedSrc, dest) - } else { - let resolvedDest - try { - resolvedDest = fs.readlinkSync(dest) - } catch (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) - throw err - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) - } - - // prevent copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) - } - return copyLink(resolvedSrc, dest) - } -} - -function copyLink (resolvedSrc, dest) { - fs.unlinkSync(dest) - return fs.symlinkSync(resolvedSrc, dest) -} - -module.exports = copySync - - -/***/ }), - -/***/ 78777: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - copySync: __webpack_require__(72574) -} - - -/***/ }), - -/***/ 77521: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdirp = __webpack_require__(89715).mkdirs -const pathExists = __webpack_require__(63033).pathExists -const utimes = __webpack_require__(20629).utimesMillis -const stat = __webpack_require__(68755) - -function copy (src, dest, opts, cb) { - if (typeof opts === 'function' && !cb) { - cb = opts - opts = {} - } else if (typeof opts === 'function') { - opts = { filter: opts } - } - - cb = cb || function () {} - opts = opts || {} - - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n - see https://github.com/jprichardson/node-fs-extra/issues/269`) - } - - stat.checkPaths(src, dest, 'copy', (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'copy', err => { - if (err) return cb(err) - if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) - return checkParentDir(destStat, src, dest, opts, cb) - }) - }) -} - -function checkParentDir (destStat, src, dest, opts, cb) { - const destParent = path.dirname(dest) - pathExists(destParent, (err, dirExists) => { - if (err) return cb(err) - if (dirExists) return startCopy(destStat, src, dest, opts, cb) - mkdirp(destParent, err => { - if (err) return cb(err) - return startCopy(destStat, src, dest, opts, cb) - }) - }) -} - -function handleFilter (onInclude, destStat, src, dest, opts, cb) { - Promise.resolve(opts.filter(src, dest)).then(include => { - if (include) return onInclude(destStat, src, dest, opts, cb) - return cb() - }, error => cb(error)) -} - -function startCopy (destStat, src, dest, opts, cb) { - if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) - return getStats(destStat, src, dest, opts, cb) -} - -function getStats (destStat, src, dest, opts, cb) { - const stat = opts.dereference ? fs.stat : fs.lstat - stat(src, (err, srcStat) => { - if (err) return cb(err) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) - }) -} - -function onFile (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return copyFile(srcStat, src, dest, opts, cb) - return mayCopyFile(srcStat, src, dest, opts, cb) -} - -function mayCopyFile (srcStat, src, dest, opts, cb) { - if (opts.overwrite) { - fs.unlink(dest, err => { - if (err) return cb(err) - return copyFile(srcStat, src, dest, opts, cb) - }) - } else if (opts.errorOnExist) { - return cb(new Error(`'${dest}' already exists`)) - } else return cb() -} - -function copyFile (srcStat, src, dest, opts, cb) { - if (typeof fs.copyFile === 'function') { - return fs.copyFile(src, dest, err => { - if (err) return cb(err) - return setDestModeAndTimestamps(srcStat, dest, opts, cb) - }) - } - return copyFileFallback(srcStat, src, dest, opts, cb) -} - -function copyFileFallback (srcStat, src, dest, opts, cb) { - const rs = fs.createReadStream(src) - rs.on('error', err => cb(err)).once('open', () => { - const ws = fs.createWriteStream(dest, { mode: srcStat.mode }) - ws.on('error', err => cb(err)) - .on('open', () => rs.pipe(ws)) - .once('close', () => setDestModeAndTimestamps(srcStat, dest, opts, cb)) - }) -} - -function setDestModeAndTimestamps (srcStat, dest, opts, cb) { - fs.chmod(dest, srcStat.mode, err => { - if (err) return cb(err) - if (opts.preserveTimestamps) { - return utimes(dest, srcStat.atime, srcStat.mtime, cb) - } - return cb() - }) -} - -function onDir (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return mkDirAndCopy(srcStat, src, dest, opts, cb) - if (destStat && !destStat.isDirectory()) { - return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) - } - return copyDir(src, dest, opts, cb) -} - -function mkDirAndCopy (srcStat, src, dest, opts, cb) { - fs.mkdir(dest, err => { - if (err) return cb(err) - copyDir(src, dest, opts, err => { - if (err) return cb(err) - return fs.chmod(dest, srcStat.mode, cb) - }) - }) -} - -function copyDir (src, dest, opts, cb) { - fs.readdir(src, (err, items) => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) -} - -function copyDirItems (items, src, dest, opts, cb) { - const item = items.pop() - if (!item) return cb() - return copyDirItem(items, item, src, dest, opts, cb) -} - -function copyDirItem (items, item, src, dest, opts, cb) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => { - if (err) return cb(err) - const { destStat } = stats - startCopy(destStat, srcItem, destItem, opts, err => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) - }) -} - -function onLink (destStat, src, dest, opts, cb) { - fs.readlink(src, (err, resolvedSrc) => { - if (err) return cb(err) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlink(resolvedSrc, dest, cb) - } else { - fs.readlink(dest, (err, resolvedDest) => { - if (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) - return cb(err) - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) - } - - // do not copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) - } - return copyLink(resolvedSrc, dest, cb) - }) - } - }) -} - -function copyLink (resolvedSrc, dest, cb) { - fs.unlink(dest, err => { - if (err) return cb(err) - return fs.symlink(resolvedSrc, dest, cb) - }) -} - -module.exports = copy - - -/***/ }), - -/***/ 30394: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -module.exports = { - copy: u(__webpack_require__(77521)) -} - - -/***/ }), - -/***/ 89693: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(89715) -const remove = __webpack_require__(16487) - -const emptyDir = u(function emptyDir (dir, callback) { - callback = callback || function () {} - fs.readdir(dir, (err, items) => { - if (err) return mkdir.mkdirs(dir, callback) - - items = items.map(item => path.join(dir, item)) - - deleteItem() - - function deleteItem () { - const item = items.pop() - if (!item) return callback() - remove.remove(item, err => { - if (err) return callback(err) - deleteItem() - }) - } - }) -}) - -function emptyDirSync (dir) { - let items - try { - items = fs.readdirSync(dir) - } catch (err) { - return mkdir.mkdirsSync(dir) - } - - items.forEach(item => { - item = path.join(dir, item) - remove.removeSync(item) - }) -} - -module.exports = { - emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir, - emptydir: emptyDir -} - - -/***/ }), - -/***/ 41572: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(89715) -const pathExists = __webpack_require__(63033).pathExists - -function createFile (file, callback) { - function makeFile () { - fs.writeFile(file, '', err => { - if (err) return callback(err) - callback() - }) - } - - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err - if (!err && stats.isFile()) return callback() - const dir = path.dirname(file) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return makeFile() - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeFile() - }) - }) - }) -} - -function createFileSync (file) { - let stats - try { - stats = fs.statSync(file) - } catch (e) {} - if (stats && stats.isFile()) return - - const dir = path.dirname(file) - if (!fs.existsSync(dir)) { - mkdir.mkdirsSync(dir) - } - - fs.writeFileSync(file, '') -} - -module.exports = { - createFile: u(createFile), - createFileSync -} - - -/***/ }), - -/***/ 56542: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const file = __webpack_require__(41572) -const link = __webpack_require__(17380) -const symlink = __webpack_require__(85014) - -module.exports = { - // file - createFile: file.createFile, - createFileSync: file.createFileSync, - ensureFile: file.createFile, - ensureFileSync: file.createFileSync, - // link - createLink: link.createLink, - createLinkSync: link.createLinkSync, - ensureLink: link.createLink, - ensureLinkSync: link.createLinkSync, - // symlink - createSymlink: symlink.createSymlink, - createSymlinkSync: symlink.createSymlinkSync, - ensureSymlink: symlink.createSymlink, - ensureSymlinkSync: symlink.createSymlinkSync -} - - -/***/ }), - -/***/ 17380: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const mkdir = __webpack_require__(89715) -const pathExists = __webpack_require__(63033).pathExists - -function createLink (srcpath, dstpath, callback) { - function makeLink (srcpath, dstpath) { - fs.link(srcpath, dstpath, err => { - if (err) return callback(err) - callback(null) - }) - } - - pathExists(dstpath, (err, destinationExists) => { - if (err) return callback(err) - if (destinationExists) return callback(null) - fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureLink') - return callback(err) - } - - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return makeLink(srcpath, dstpath) - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeLink(srcpath, dstpath) - }) - }) - }) - }) -} - -function createLinkSync (srcpath, dstpath) { - const destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - try { - fs.lstatSync(srcpath) - } catch (err) { - err.message = err.message.replace('lstat', 'ensureLink') - throw err - } - - const dir = path.dirname(dstpath) - const dirExists = fs.existsSync(dir) - if (dirExists) return fs.linkSync(srcpath, dstpath) - mkdir.mkdirsSync(dir) - - return fs.linkSync(srcpath, dstpath) -} - -module.exports = { - createLink: u(createLink), - createLinkSync -} - - -/***/ }), - -/***/ 42738: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const pathExists = __webpack_require__(63033).pathExists - -/** - * Function that returns two types of paths, one relative to symlink, and one - * relative to the current working directory. Checks if path is absolute or - * relative. If the path is relative, this function checks if the path is - * relative to symlink or relative to current working directory. This is an - * initiative to find a smarter `srcpath` to supply when building symlinks. - * This allows you to determine which path to use out of one of three possible - * types of source paths. The first is an absolute path. This is detected by - * `path.isAbsolute()`. When an absolute path is provided, it is checked to - * see if it exists. If it does it's used, if not an error is returned - * (callback)/ thrown (sync). The other two options for `srcpath` are a - * relative url. By default Node's `fs.symlink` works by creating a symlink - * using `dstpath` and expects the `srcpath` to be relative to the newly - * created symlink. If you provide a `srcpath` that does not exist on the file - * system it results in a broken symlink. To minimize this, the function - * checks to see if the 'relative to symlink' source file exists, and if it - * does it will use it. If it does not, it checks if there's a file that - * exists that is relative to the current working directory, if does its used. - * This preserves the expectations of the original fs.symlink spec and adds - * the ability to pass in `relative to current working direcotry` paths. - */ - -function symlinkPaths (srcpath, dstpath, callback) { - if (path.isAbsolute(srcpath)) { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - 'toCwd': srcpath, - 'toDst': srcpath - }) - }) - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - return pathExists(relativeToDst, (err, exists) => { - if (err) return callback(err) - if (exists) { - return callback(null, { - 'toCwd': relativeToDst, - 'toDst': srcpath - }) - } else { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - 'toCwd': srcpath, - 'toDst': path.relative(dstdir, srcpath) - }) - }) - } - }) - } -} - -function symlinkPathsSync (srcpath, dstpath) { - let exists - if (path.isAbsolute(srcpath)) { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('absolute srcpath does not exist') - return { - 'toCwd': srcpath, - 'toDst': srcpath - } - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - exists = fs.existsSync(relativeToDst) - if (exists) { - return { - 'toCwd': relativeToDst, - 'toDst': srcpath - } - } else { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('relative srcpath does not exist') - return { - 'toCwd': srcpath, - 'toDst': path.relative(dstdir, srcpath) - } - } - } -} - -module.exports = { - symlinkPaths, - symlinkPathsSync -} - - -/***/ }), - -/***/ 43874: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) - -function symlinkType (srcpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - if (type) return callback(null, type) - fs.lstat(srcpath, (err, stats) => { - if (err) return callback(null, 'file') - type = (stats && stats.isDirectory()) ? 'dir' : 'file' - callback(null, type) - }) -} - -function symlinkTypeSync (srcpath, type) { - let stats - - if (type) return type - try { - stats = fs.lstatSync(srcpath) - } catch (e) { - return 'file' - } - return (stats && stats.isDirectory()) ? 'dir' : 'file' -} - -module.exports = { - symlinkType, - symlinkTypeSync -} - - -/***/ }), - -/***/ 85014: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const path = __webpack_require__(85622) -const fs = __webpack_require__(82161) -const _mkdirs = __webpack_require__(89715) -const mkdirs = _mkdirs.mkdirs -const mkdirsSync = _mkdirs.mkdirsSync - -const _symlinkPaths = __webpack_require__(42738) -const symlinkPaths = _symlinkPaths.symlinkPaths -const symlinkPathsSync = _symlinkPaths.symlinkPathsSync - -const _symlinkType = __webpack_require__(43874) -const symlinkType = _symlinkType.symlinkType -const symlinkTypeSync = _symlinkType.symlinkTypeSync - -const pathExists = __webpack_require__(63033).pathExists - -function createSymlink (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - pathExists(dstpath, (err, destinationExists) => { - if (err) return callback(err) - if (destinationExists) return callback(null) - symlinkPaths(srcpath, dstpath, (err, relative) => { - if (err) return callback(err) - srcpath = relative.toDst - symlinkType(relative.toCwd, type, (err, type) => { - if (err) return callback(err) - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) - mkdirs(dir, err => { - if (err) return callback(err) - fs.symlink(srcpath, dstpath, type, callback) - }) - }) - }) - }) - }) -} - -function createSymlinkSync (srcpath, dstpath, type) { - const destinationExists = fs.existsSync(dstpath) - if (destinationExists) return undefined - - const relative = symlinkPathsSync(srcpath, dstpath) - srcpath = relative.toDst - type = symlinkTypeSync(relative.toCwd, type) - const dir = path.dirname(dstpath) - const exists = fs.existsSync(dir) - if (exists) return fs.symlinkSync(srcpath, dstpath, type) - mkdirsSync(dir) - return fs.symlinkSync(srcpath, dstpath, type) -} - -module.exports = { - createSymlink: u(createSymlink), - createSymlinkSync -} - - -/***/ }), - -/***/ 89372: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -// This is adapted from https://github.com/normalize/mz -// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors -const u = __webpack_require__(57258)/* .fromCallback */ .E -const fs = __webpack_require__(82161) - -const api = [ - 'access', - 'appendFile', - 'chmod', - 'chown', - 'close', - 'copyFile', - 'fchmod', - 'fchown', - 'fdatasync', - 'fstat', - 'fsync', - 'ftruncate', - 'futimes', - 'lchown', - 'lchmod', - 'link', - 'lstat', - 'mkdir', - 'mkdtemp', - 'open', - 'readFile', - 'readdir', - 'readlink', - 'realpath', - 'rename', - 'rmdir', - 'stat', - 'symlink', - 'truncate', - 'unlink', - 'utimes', - 'writeFile' -].filter(key => { - // Some commands are not available on some systems. Ex: - // fs.copyFile was added in Node.js v8.5.0 - // fs.mkdtemp was added in Node.js v5.10.0 - // fs.lchown is not available on at least some Linux - return typeof fs[key] === 'function' -}) - -// Export all keys: -Object.keys(fs).forEach(key => { - if (key === 'promises') { - // fs.promises is a getter property that triggers ExperimentalWarning - // Don't re-export it here, the getter is defined in "lib/index.js" - return - } - exports[key] = fs[key] -}) - -// Universalify async methods: -api.forEach(method => { - exports[method] = u(fs[method]) -}) - -// We differ from mz/fs in that we still ship the old, broken, fs.exists() -// since we are a drop-in replacement for the native module -exports.exists = function (filename, callback) { - if (typeof callback === 'function') { - return fs.exists(filename, callback) - } - return new Promise(resolve => { - return fs.exists(filename, resolve) - }) -} - -// fs.read() & fs.write need special treatment due to multiple callback args - -exports.read = function (fd, buffer, offset, length, position, callback) { - if (typeof callback === 'function') { - return fs.read(fd, buffer, offset, length, position, callback) - } - return new Promise((resolve, reject) => { - fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { - if (err) return reject(err) - resolve({ bytesRead, buffer }) - }) - }) -} - -// Function signature can be -// fs.write(fd, buffer[, offset[, length[, position]]], callback) -// OR -// fs.write(fd, string[, position[, encoding]], callback) -// We need to handle both cases, so we use ...args -exports.write = function (fd, buffer, ...args) { - if (typeof args[args.length - 1] === 'function') { - return fs.write(fd, buffer, ...args) - } - - return new Promise((resolve, reject) => { - fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { - if (err) return reject(err) - resolve({ bytesWritten, buffer }) - }) - }) -} - -// fs.realpath.native only available in Node v9.2+ -if (typeof fs.realpath.native === 'function') { - exports.realpath.native = u(fs.realpath.native) -} - - -/***/ }), - -/***/ 35296: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = Object.assign( - {}, - // Export promiseified graceful-fs: - __webpack_require__(89372), - // Export extra methods: - __webpack_require__(78777), - __webpack_require__(30394), - __webpack_require__(89693), - __webpack_require__(56542), - __webpack_require__(92279), - __webpack_require__(89715), - __webpack_require__(3156), - __webpack_require__(85713), - __webpack_require__(71995), - __webpack_require__(63033), - __webpack_require__(16487) -) - -// Export fs.promises as a getter property so that we don't trigger -// ExperimentalWarning before fs.promises is actually accessed. -const fs = __webpack_require__(35747) -if (Object.getOwnPropertyDescriptor(fs, 'promises')) { - Object.defineProperty(module.exports, "promises", ({ - get () { return fs.promises } - })) -} - - -/***/ }), - -/***/ 92279: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const jsonFile = __webpack_require__(66669) - -jsonFile.outputJson = u(__webpack_require__(95343)) -jsonFile.outputJsonSync = __webpack_require__(47716) -// aliases -jsonFile.outputJSON = jsonFile.outputJson -jsonFile.outputJSONSync = jsonFile.outputJsonSync -jsonFile.writeJSON = jsonFile.writeJson -jsonFile.writeJSONSync = jsonFile.writeJsonSync -jsonFile.readJSON = jsonFile.readJson -jsonFile.readJSONSync = jsonFile.readJsonSync - -module.exports = jsonFile - - -/***/ }), - -/***/ 66669: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const jsonFile = __webpack_require__(75362) - -module.exports = { - // jsonfile exports - readJson: u(jsonFile.readFile), - readJsonSync: jsonFile.readFileSync, - writeJson: u(jsonFile.writeFile), - writeJsonSync: jsonFile.writeFileSync -} - - -/***/ }), - -/***/ 47716: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(89715) -const jsonFile = __webpack_require__(66669) - -function outputJsonSync (file, data, options) { - const dir = path.dirname(file) - - if (!fs.existsSync(dir)) { - mkdir.mkdirsSync(dir) - } - - jsonFile.writeJsonSync(file, data, options) -} - -module.exports = outputJsonSync - - -/***/ }), - -/***/ 95343: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(89715) -const pathExists = __webpack_require__(63033).pathExists -const jsonFile = __webpack_require__(66669) - -function outputJson (file, data, options, callback) { - if (typeof options === 'function') { - callback = options - options = {} - } - - const dir = path.dirname(file) - - pathExists(dir, (err, itDoes) => { - if (err) return callback(err) - if (itDoes) return jsonFile.writeJson(file, data, options, callback) - - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - jsonFile.writeJson(file, data, options, callback) - }) - }) -} - -module.exports = outputJson - - -/***/ }), - -/***/ 89715: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const mkdirs = u(__webpack_require__(55065)) -const mkdirsSync = __webpack_require__(37105) - -module.exports = { - mkdirs, - mkdirsSync, - // alias - mkdirp: mkdirs, - mkdirpSync: mkdirsSync, - ensureDir: mkdirs, - ensureDirSync: mkdirsSync -} - - -/***/ }), - -/***/ 37105: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const invalidWin32Path = __webpack_require__(30152).invalidWin32Path - -const o777 = parseInt('0777', 8) - -function mkdirsSync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts } - } - - let mode = opts.mode - const xfs = opts.fs || fs - - if (process.platform === 'win32' && invalidWin32Path(p)) { - const errInval = new Error(p + ' contains invalid WIN32 path characters.') - errInval.code = 'EINVAL' - throw errInval - } - - if (mode === undefined) { - mode = o777 & (~process.umask()) - } - if (!made) made = null - - p = path.resolve(p) - - try { - xfs.mkdirSync(p, mode) - made = made || p - } catch (err0) { - if (err0.code === 'ENOENT') { - if (path.dirname(p) === p) throw err0 - made = mkdirsSync(path.dirname(p), opts, made) - mkdirsSync(p, opts, made) - } else { - // In the case of any other error, just see if there's a dir there - // already. If so, then hooray! If not, then something is borked. - let stat - try { - stat = xfs.statSync(p) - } catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0 - } - } - - return made -} - -module.exports = mkdirsSync - - -/***/ }), - -/***/ 55065: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const invalidWin32Path = __webpack_require__(30152).invalidWin32Path - -const o777 = parseInt('0777', 8) - -function mkdirs (p, opts, callback, made) { - if (typeof opts === 'function') { - callback = opts - opts = {} - } else if (!opts || typeof opts !== 'object') { - opts = { mode: opts } - } - - if (process.platform === 'win32' && invalidWin32Path(p)) { - const errInval = new Error(p + ' contains invalid WIN32 path characters.') - errInval.code = 'EINVAL' - return callback(errInval) - } - - let mode = opts.mode - const xfs = opts.fs || fs - - if (mode === undefined) { - mode = o777 & (~process.umask()) - } - if (!made) made = null - - callback = callback || function () {} - p = path.resolve(p) - - xfs.mkdir(p, mode, er => { - if (!er) { - made = made || p - return callback(null, made) - } - switch (er.code) { - case 'ENOENT': - if (path.dirname(p) === p) return callback(er) - mkdirs(path.dirname(p), opts, (er, made) => { - if (er) callback(er, made) - else mkdirs(p, opts, callback, made) - }) - break - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, (er2, stat) => { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) callback(er, made) - else callback(null, made) - }) - break - } - }) -} - -module.exports = mkdirs - - -/***/ }), - -/***/ 30152: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(85622) - -// get drive on windows -function getRootPath (p) { - p = path.normalize(path.resolve(p)).split(path.sep) - if (p.length > 0) return p[0] - return null -} - -// http://stackoverflow.com/a/62888/10333 contains more accurate -// TODO: expand to include the rest -const INVALID_PATH_CHARS = /[<>:"|?*]/ - -function invalidWin32Path (p) { - const rp = getRootPath(p) - p = p.replace(rp, '') - return INVALID_PATH_CHARS.test(p) -} - -module.exports = { - getRootPath, - invalidWin32Path -} - - -/***/ }), - -/***/ 3156: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = { - moveSync: __webpack_require__(23471) -} - - -/***/ }), - -/***/ 23471: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copySync = __webpack_require__(78777).copySync -const removeSync = __webpack_require__(16487).removeSync -const mkdirpSync = __webpack_require__(89715).mkdirpSync -const stat = __webpack_require__(68755) - -function moveSync (src, dest, opts) { - opts = opts || {} - const overwrite = opts.overwrite || opts.clobber || false - - const { srcStat } = stat.checkPathsSync(src, dest, 'move') - stat.checkParentPathsSync(src, srcStat, dest, 'move') - mkdirpSync(path.dirname(dest)) - return doRename(src, dest, overwrite) -} - -function doRename (src, dest, overwrite) { - if (overwrite) { - removeSync(dest) - return rename(src, dest, overwrite) - } - if (fs.existsSync(dest)) throw new Error('dest already exists.') - return rename(src, dest, overwrite) -} - -function rename (src, dest, overwrite) { - try { - fs.renameSync(src, dest) - } catch (err) { - if (err.code !== 'EXDEV') throw err - return moveAcrossDevice(src, dest, overwrite) - } -} - -function moveAcrossDevice (src, dest, overwrite) { - const opts = { - overwrite, - errorOnExist: true - } - copySync(src, dest, opts) - return removeSync(src) -} - -module.exports = moveSync - - -/***/ }), - -/***/ 85713: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -module.exports = { - move: u(__webpack_require__(40296)) -} - - -/***/ }), - -/***/ 40296: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const copy = __webpack_require__(30394).copy -const remove = __webpack_require__(16487).remove -const mkdirp = __webpack_require__(89715).mkdirp -const pathExists = __webpack_require__(63033).pathExists -const stat = __webpack_require__(68755) - -function move (src, dest, opts, cb) { - if (typeof opts === 'function') { - cb = opts - opts = {} - } - - const overwrite = opts.overwrite || opts.clobber || false - - stat.checkPaths(src, dest, 'move', (err, stats) => { - if (err) return cb(err) - const { srcStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'move', err => { - if (err) return cb(err) - mkdirp(path.dirname(dest), err => { - if (err) return cb(err) - return doRename(src, dest, overwrite, cb) - }) - }) - }) -} - -function doRename (src, dest, overwrite, cb) { - if (overwrite) { - return remove(dest, err => { - if (err) return cb(err) - return rename(src, dest, overwrite, cb) - }) - } - pathExists(dest, (err, destExists) => { - if (err) return cb(err) - if (destExists) return cb(new Error('dest already exists.')) - return rename(src, dest, overwrite, cb) - }) -} - -function rename (src, dest, overwrite, cb) { - fs.rename(src, dest, err => { - if (!err) return cb() - if (err.code !== 'EXDEV') return cb(err) - return moveAcrossDevice(src, dest, overwrite, cb) - }) -} - -function moveAcrossDevice (src, dest, overwrite, cb) { - const opts = { - overwrite, - errorOnExist: true - } - copy(src, dest, opts, err => { - if (err) return cb(err) - return remove(src, cb) - }) -} - -module.exports = move - - -/***/ }), - -/***/ 71995: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const mkdir = __webpack_require__(89715) -const pathExists = __webpack_require__(63033).pathExists - -function outputFile (file, data, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding - encoding = 'utf8' - } - - const dir = path.dirname(file) - pathExists(dir, (err, itDoes) => { - if (err) return callback(err) - if (itDoes) return fs.writeFile(file, data, encoding, callback) - - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - - fs.writeFile(file, data, encoding, callback) - }) - }) -} - -function outputFileSync (file, ...args) { - const dir = path.dirname(file) - if (fs.existsSync(dir)) { - return fs.writeFileSync(file, ...args) - } - mkdir.mkdirsSync(dir) - fs.writeFileSync(file, ...args) -} - -module.exports = { - outputFile: u(outputFile), - outputFileSync -} - - -/***/ }), - -/***/ 63033: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const u = __webpack_require__(57258)/* .fromPromise */ .p -const fs = __webpack_require__(89372) - -function pathExists (path) { - return fs.access(path).then(() => true).catch(() => false) -} - -module.exports = { - pathExists: u(pathExists), - pathExistsSync: fs.existsSync -} - - -/***/ }), - -/***/ 16487: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const u = __webpack_require__(57258)/* .fromCallback */ .E -const rimraf = __webpack_require__(11098) - -module.exports = { - remove: u(rimraf), - removeSync: rimraf.sync -} - - -/***/ }), - -/***/ 11098: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) -const assert = __webpack_require__(42357) - -const isWindows = (process.platform === 'win32') +const stop = Symbol('findUp.stop'); -function defaults (options) { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) +module.exports = async (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); - options.maxBusyTries = options.maxBusyTries || 3 -} + const runMatcher = async locateOptions => { + if (typeof name !== 'function') { + return locatePath(paths, locateOptions); + } -function rimraf (p, options, cb) { - let busyTries = 0 + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath([foundPath], locateOptions); + } - if (typeof options === 'function') { - cb = options - options = {} - } + return foundPath; + }; - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') + // eslint-disable-next-line no-constant-condition + while (true) { + // eslint-disable-next-line no-await-in-loop + const foundPath = await runMatcher({...options, cwd: directory}); - defaults(options) + if (foundPath === stop) { + return; + } - rimraf_(p, options, function CB (er) { - if (er) { - if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && - busyTries < options.maxBusyTries) { - busyTries++ - const time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), time) - } + if (foundPath) { + return path.resolve(directory, foundPath); + } - // already gone - if (er.code === 'ENOENT') er = null - } + if (directory === root) { + return; + } - cb(er) - }) -} + directory = path.dirname(directory); + } +}; -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') +module.exports.sync = (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === 'ENOENT') { - return cb(null) - } + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePath.sync(paths, locateOptions); + } - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === 'EPERM' && isWindows) { - return fixWinEPERM(p, options, er, cb) - } + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath.sync([foundPath], locateOptions); + } - if (st && st.isDirectory()) { - return rmdir(p, options, er, cb) - } + return foundPath; + }; - options.unlink(p, er => { - if (er) { - if (er.code === 'ENOENT') { - return cb(null) - } - if (er.code === 'EPERM') { - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - } - if (er.code === 'EISDIR') { - return rmdir(p, options, er, cb) - } - } - return cb(er) - }) - }) -} + // eslint-disable-next-line no-constant-condition + while (true) { + const foundPath = runMatcher({...options, cwd: directory}); -function fixWinEPERM (p, options, er, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - if (er) { - assert(er instanceof Error) - } + if (foundPath === stop) { + return; + } - options.chmod(p, 0o666, er2 => { - if (er2) { - cb(er2.code === 'ENOENT' ? null : er) - } else { - options.stat(p, (er3, stats) => { - if (er3) { - cb(er3.code === 'ENOENT' ? null : er) - } else if (stats.isDirectory()) { - rmdir(p, options, er, cb) - } else { - options.unlink(p, cb) - } - }) - } - }) -} + if (foundPath) { + return path.resolve(directory, foundPath); + } -function fixWinEPERMSync (p, options, er) { - let stats + if (directory === root) { + return; + } - assert(p) - assert(options) - if (er) { - assert(er instanceof Error) - } + directory = path.dirname(directory); + } +}; - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === 'ENOENT') { - return - } else { - throw er - } - } +module.exports.exists = pathExists; - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === 'ENOENT') { - return - } else { - throw er - } - } +module.exports.sync.exists = pathExists.sync; - if (stats.isDirectory()) { - rmdirSync(p, options, er) - } else { - options.unlinkSync(p) - } -} +module.exports.stop = stop; -function rmdir (p, options, originalEr, cb) { - assert(p) - assert(options) - if (originalEr) { - assert(originalEr instanceof Error) - } - assert(typeof cb === 'function') - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { - rmkids(p, options, cb) - } else if (er && er.code === 'ENOTDIR') { - cb(originalEr) - } else { - cb(er) - } - }) -} +/***/ }), -function rmkids (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') +/***/ 89255: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - options.readdir(p, (er, files) => { - if (er) return cb(er) +"use strict"; - let n = files.length - let errState +const fs = __nccwpck_require__(35747); +const {promisify} = __nccwpck_require__(31669); - if (n === 0) return options.rmdir(p, cb) +const pAccess = promisify(fs.access); - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) { - return - } - if (er) return cb(errState = er) - if (--n === 0) { - options.rmdir(p, cb) - } - }) - }) - }) -} +module.exports = async path => { + try { + await pAccess(path); + return true; + } catch (_) { + return false; + } +}; -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -function rimrafSync (p, options) { - let st +module.exports.sync = path => { + try { + fs.accessSync(path); + return true; + } catch (_) { + return false; + } +}; - options = options || {} - defaults(options) - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') +/***/ }), - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === 'ENOENT') { - return - } +/***/ 60123: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Windows can EPERM on stat. Life is suffering. - if (er.code === 'EPERM' && isWindows) { - fixWinEPERMSync(p, options, er) - } - } +"use strict"; - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) { - rmdirSync(p, options, null) - } else { - options.unlinkSync(p) - } - } catch (er) { - if (er.code === 'ENOENT') { - return - } else if (er.code === 'EPERM') { - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - } else if (er.code !== 'EISDIR') { - throw er - } - rmdirSync(p, options, er) - } -} -function rmdirSync (p, options, originalEr) { - assert(p) - assert(options) - if (originalEr) { - assert(originalEr instanceof Error) - } +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdirsSync = __nccwpck_require__(81881).mkdirsSync +const utimesMillisSync = __nccwpck_require__(64698).utimesMillisSync +const stat = __nccwpck_require__(66834) - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === 'ENOTDIR') { - throw originalEr - } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { - rmkidsSync(p, options) - } else if (er.code !== 'ENOENT') { - throw er - } +function copySync (src, dest, opts) { + if (typeof opts === 'function') { + opts = { filter: opts } } -} -function rmkidsSync (p, options) { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + opts = opts || {} + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - if (isWindows) { - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const startTime = Date.now() - do { - try { - const ret = options.rmdirSync(p, options) - return ret - } catch (er) { } - } while (Date.now() - startTime < 500) // give up after 500ms - } else { - const ret = options.rmdirSync(p, options) - return ret + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) } + + const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy') + stat.checkParentPathsSync(src, srcStat, dest, 'copy') + return handleFilterAndCopy(destStat, src, dest, opts) } -module.exports = rimraf -rimraf.sync = rimrafSync +function handleFilterAndCopy (destStat, src, dest, opts) { + if (opts.filter && !opts.filter(src, dest)) return + const destParent = path.dirname(dest) + if (!fs.existsSync(destParent)) mkdirsSync(destParent) + return startCopy(destStat, src, dest, opts) +} +function startCopy (destStat, src, dest, opts) { + if (opts.filter && !opts.filter(src, dest)) return + return getStats(destStat, src, dest, opts) +} -/***/ }), +function getStats (destStat, src, dest, opts) { + const statSync = opts.dereference ? fs.statSync : fs.lstatSync + const srcStat = statSync(src) -/***/ 57981: -/***/ ((module) => { + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) + else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) + else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) +} -"use strict"; +function onFile (srcStat, destStat, src, dest, opts) { + if (!destStat) return copyFile(srcStat, src, dest, opts) + return mayCopyFile(srcStat, src, dest, opts) +} -/* eslint-disable node/no-deprecated-api */ -module.exports = function (size) { - if (typeof Buffer.allocUnsafe === 'function') { - try { - return Buffer.allocUnsafe(size) - } catch (e) { - return new Buffer(size) - } +function mayCopyFile (srcStat, src, dest, opts) { + if (opts.overwrite) { + fs.unlinkSync(dest) + return copyFile(srcStat, src, dest, opts) + } else if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`) } - return new Buffer(size) } +function copyFile (srcStat, src, dest, opts) { + fs.copyFileSync(src, dest) + if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) + return setDestMode(dest, srcStat.mode) +} -/***/ }), - -/***/ 68755: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; +function handleTimestamps (srcMode, src, dest) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) + return setDestTimestamps(src, dest) +} +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 +} -const fs = __webpack_require__(82161) -const path = __webpack_require__(85622) +function makeFileWritable (dest, srcMode) { + return setDestMode(dest, srcMode | 0o200) +} -const NODE_VERSION_MAJOR_WITH_BIGINT = 10 -const NODE_VERSION_MINOR_WITH_BIGINT = 5 -const NODE_VERSION_PATCH_WITH_BIGINT = 0 -const nodeVersion = process.versions.node.split('.') -const nodeVersionMajor = Number.parseInt(nodeVersion[0], 10) -const nodeVersionMinor = Number.parseInt(nodeVersion[1], 10) -const nodeVersionPatch = Number.parseInt(nodeVersion[2], 10) +function setDestMode (dest, srcMode) { + return fs.chmodSync(dest, srcMode) +} -function nodeSupportsBigInt () { - if (nodeVersionMajor > NODE_VERSION_MAJOR_WITH_BIGINT) { - return true - } else if (nodeVersionMajor === NODE_VERSION_MAJOR_WITH_BIGINT) { - if (nodeVersionMinor > NODE_VERSION_MINOR_WITH_BIGINT) { - return true - } else if (nodeVersionMinor === NODE_VERSION_MINOR_WITH_BIGINT) { - if (nodeVersionPatch >= NODE_VERSION_PATCH_WITH_BIGINT) { - return true - } - } - } - return false +function setDestTimestamps (src, dest) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + const updatedSrcStat = fs.statSync(src) + return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) } -function getStats (src, dest, cb) { - if (nodeSupportsBigInt()) { - fs.stat(src, { bigint: true }, (err, srcStat) => { - if (err) return cb(err) - fs.stat(dest, { bigint: true }, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb(null, { srcStat, destStat: null }) - return cb(err) - } - return cb(null, { srcStat, destStat }) - }) - }) - } else { - fs.stat(src, (err, srcStat) => { - if (err) return cb(err) - fs.stat(dest, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb(null, { srcStat, destStat: null }) - return cb(err) - } - return cb(null, { srcStat, destStat }) - }) - }) +function onDir (srcStat, destStat, src, dest, opts) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) + if (destStat && !destStat.isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) } + return copyDir(src, dest, opts) } -function getStatsSync (src, dest) { - let srcStat, destStat - if (nodeSupportsBigInt()) { - srcStat = fs.statSync(src, { bigint: true }) - } else { - srcStat = fs.statSync(src) - } - try { - if (nodeSupportsBigInt()) { - destStat = fs.statSync(dest, { bigint: true }) - } else { - destStat = fs.statSync(dest) - } - } catch (err) { - if (err.code === 'ENOENT') return { srcStat, destStat: null } - throw err - } - return { srcStat, destStat } +function mkDirAndCopy (srcMode, src, dest, opts) { + fs.mkdirSync(dest) + copyDir(src, dest, opts) + return setDestMode(dest, srcMode) } -function checkPaths (src, dest, funcName, cb) { - getStats(src, dest, (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - if (destStat && destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - return cb(new Error('Source and destination must not be the same.')) - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return cb(null, { srcStat, destStat }) - }) +function copyDir (src, dest, opts) { + fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) } -function checkPathsSync (src, dest, funcName) { - const { srcStat, destStat } = getStatsSync(src, dest) - if (destStat && destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - throw new Error('Source and destination must not be the same.') - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - throw new Error(errMsg(src, dest, funcName)) - } - return { srcStat, destStat } +function copyDirItem (item, src, dest, opts) { + const srcItem = path.join(src, item) + const destItem = path.join(dest, item) + const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy') + return startCopy(destStat, srcItem, destItem, opts) } -// recursively check if dest parent is a subdirectory of src. -// It works for all file types including symlinks since it -// checks the src and dest inodes. It starts from the deepest -// parent and stops once it reaches the src parent or the root path. -function checkParentPaths (src, srcStat, dest, funcName, cb) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() - if (nodeSupportsBigInt()) { - fs.stat(destParent, { bigint: true }, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb() - return cb(err) - } - if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return checkParentPaths(src, srcStat, destParent, funcName, cb) - }) - } else { - fs.stat(destParent, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb() - return cb(err) - } - if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return checkParentPaths(src, srcStat, destParent, funcName, cb) - }) +function onLink (destStat, src, dest, opts) { + let resolvedSrc = fs.readlinkSync(src) + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc) } -} -function checkParentPathsSync (src, srcStat, dest, funcName) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return - let destStat - try { - if (nodeSupportsBigInt()) { - destStat = fs.statSync(destParent, { bigint: true }) - } else { - destStat = fs.statSync(destParent) + if (!destStat) { + return fs.symlinkSync(resolvedSrc, dest) + } else { + let resolvedDest + try { + resolvedDest = fs.readlinkSync(dest) + } catch (err) { + // dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) + throw err } - } catch (err) { - if (err.code === 'ENOENT') return - throw err - } - if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { - throw new Error(errMsg(src, dest, funcName)) + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest) + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) + } + + // prevent copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) + } + return copyLink(resolvedSrc, dest) } - return checkParentPathsSync(src, srcStat, destParent, funcName) } -// return true if dest is a subdir of src, otherwise false. -// It only checks the path strings. -function isSrcSubdir (src, dest) { - const srcArr = path.resolve(src).split(path.sep).filter(i => i) - const destArr = path.resolve(dest).split(path.sep).filter(i => i) - return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) +function copyLink (resolvedSrc, dest) { + fs.unlinkSync(dest) + return fs.symlinkSync(resolvedSrc, dest) } -function errMsg (src, dest, funcName) { - return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` -} +module.exports = copySync + + +/***/ }), + +/***/ 6574: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + module.exports = { - checkPaths, - checkPathsSync, - checkParentPaths, - checkParentPathsSync, - isSrcSubdir + copySync: __nccwpck_require__(60123) } /***/ }), -/***/ 20629: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 41132: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(82161) -const os = __webpack_require__(12087) -const path = __webpack_require__(85622) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdirs = __nccwpck_require__(81881).mkdirs +const pathExists = __nccwpck_require__(42176).pathExists +const utimesMillis = __nccwpck_require__(64698).utimesMillis +const stat = __nccwpck_require__(66834) -// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not -function hasMillisResSync () { - let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) - tmpfile = path.join(os.tmpdir(), tmpfile) +function copy (src, dest, opts, cb) { + if (typeof opts === 'function' && !cb) { + cb = opts + opts = {} + } else if (typeof opts === 'function') { + opts = { filter: opts } + } - // 550 millis past UNIX epoch - const d = new Date(1435410243862) - fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') - const fd = fs.openSync(tmpfile, 'r+') - fs.futimesSync(fd, d, d) - fs.closeSync(fd) - return fs.statSync(tmpfile).mtime > 1435410243000 -} + cb = cb || function () {} + opts = opts || {} -function hasMillisRes (callback) { - let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) - tmpfile = path.join(os.tmpdir(), tmpfile) + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - // 550 millis past UNIX epoch - const d = new Date(1435410243862) - fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { - if (err) return callback(err) - fs.open(tmpfile, 'r+', (err, fd) => { - if (err) return callback(err) - fs.futimes(fd, d, d, err => { - if (err) return callback(err) - fs.close(fd, err => { - if (err) return callback(err) - fs.stat(tmpfile, (err, stats) => { - if (err) return callback(err) - callback(null, stats.mtime > 1435410243000) - }) - }) - }) + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + stat.checkPaths(src, dest, 'copy', (err, stats) => { + if (err) return cb(err) + const { srcStat, destStat } = stats + stat.checkParentPaths(src, srcStat, dest, 'copy', err => { + if (err) return cb(err) + if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) + return checkParentDir(destStat, src, dest, opts, cb) }) }) } -function timeRemoveMillis (timestamp) { - if (typeof timestamp === 'number') { - return Math.floor(timestamp / 1000) * 1000 - } else if (timestamp instanceof Date) { - return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) - } else { - throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') - } -} - -function utimesMillis (path, atime, mtime, callback) { - // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) - fs.open(path, 'r+', (err, fd) => { - if (err) return callback(err) - fs.futimes(fd, atime, mtime, futimesErr => { - fs.close(fd, closeErr => { - if (callback) callback(futimesErr || closeErr) - }) +function checkParentDir (destStat, src, dest, opts, cb) { + const destParent = path.dirname(dest) + pathExists(destParent, (err, dirExists) => { + if (err) return cb(err) + if (dirExists) return startCopy(destStat, src, dest, opts, cb) + mkdirs(destParent, err => { + if (err) return cb(err) + return startCopy(destStat, src, dest, opts, cb) }) }) } -function utimesMillisSync (path, atime, mtime) { - const fd = fs.openSync(path, 'r+') - fs.futimesSync(fd, atime, mtime) - return fs.closeSync(fd) +function handleFilter (onInclude, destStat, src, dest, opts, cb) { + Promise.resolve(opts.filter(src, dest)).then(include => { + if (include) return onInclude(destStat, src, dest, opts, cb) + return cb() + }, error => cb(error)) } -module.exports = { - hasMillisRes, - hasMillisResSync, - timeRemoveMillis, - utimesMillis, - utimesMillisSync +function startCopy (destStat, src, dest, opts, cb) { + if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) + return getStats(destStat, src, dest, opts, cb) } +function getStats (destStat, src, dest, opts, cb) { + const stat = opts.dereference ? fs.stat : fs.lstat + stat(src, (err, srcStat) => { + if (err) return cb(err) -/***/ }), + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) + else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) + else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) + }) +} -/***/ 97375: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function onFile (srcStat, destStat, src, dest, opts, cb) { + if (!destStat) return copyFile(srcStat, src, dest, opts, cb) + return mayCopyFile(srcStat, src, dest, opts, cb) +} -"use strict"; +function mayCopyFile (srcStat, src, dest, opts, cb) { + if (opts.overwrite) { + fs.unlink(dest, err => { + if (err) return cb(err) + return copyFile(srcStat, src, dest, opts, cb) + }) + } else if (opts.errorOnExist) { + return cb(new Error(`'${dest}' already exists`)) + } else return cb() +} -var Promise = __webpack_require__(4548); -var arrayUnion = __webpack_require__(39849); -var objectAssign = __webpack_require__(14594); -var glob = __webpack_require__(37966); -var pify = __webpack_require__(39160); +function copyFile (srcStat, src, dest, opts, cb) { + fs.copyFile(src, dest, err => { + if (err) return cb(err) + if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb) + return setDestMode(dest, srcStat.mode, cb) + }) +} -var globP = pify(glob, Promise).bind(glob); +function handleTimestampsAndMode (srcMode, src, dest, cb) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) { + return makeFileWritable(dest, srcMode, err => { + if (err) return cb(err) + return setDestTimestampsAndMode(srcMode, src, dest, cb) + }) + } + return setDestTimestampsAndMode(srcMode, src, dest, cb) +} -function isNegative(pattern) { - return pattern[0] === '!'; +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 } -function isString(value) { - return typeof value === 'string'; +function makeFileWritable (dest, srcMode, cb) { + return setDestMode(dest, srcMode | 0o200, cb) } -function assertPatternsInput(patterns) { - if (!patterns.every(isString)) { - throw new TypeError('patterns must be a string or an array of strings'); - } +function setDestTimestampsAndMode (srcMode, src, dest, cb) { + setDestTimestamps(src, dest, err => { + if (err) return cb(err) + return setDestMode(dest, srcMode, cb) + }) } -function generateGlobTasks(patterns, opts) { - patterns = [].concat(patterns); - assertPatternsInput(patterns); +function setDestMode (dest, srcMode, cb) { + return fs.chmod(dest, srcMode, cb) +} - var globTasks = []; +function setDestTimestamps (src, dest, cb) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + fs.stat(src, (err, updatedSrcStat) => { + if (err) return cb(err) + return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb) + }) +} - opts = objectAssign({ - cache: Object.create(null), - statCache: Object.create(null), - realpathCache: Object.create(null), - symlinks: Object.create(null), - ignore: [] - }, opts); +function onDir (srcStat, destStat, src, dest, opts, cb) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb) + if (destStat && !destStat.isDirectory()) { + return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) + } + return copyDir(src, dest, opts, cb) +} - patterns.forEach(function (pattern, i) { - if (isNegative(pattern)) { - return; - } +function mkDirAndCopy (srcMode, src, dest, opts, cb) { + fs.mkdir(dest, err => { + if (err) return cb(err) + copyDir(src, dest, opts, err => { + if (err) return cb(err) + return setDestMode(dest, srcMode, cb) + }) + }) +} - var ignore = patterns.slice(i).filter(isNegative).map(function (pattern) { - return pattern.slice(1); - }); +function copyDir (src, dest, opts, cb) { + fs.readdir(src, (err, items) => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) +} - globTasks.push({ - pattern: pattern, - opts: objectAssign({}, opts, { - ignore: opts.ignore.concat(ignore) - }) - }); - }); +function copyDirItems (items, src, dest, opts, cb) { + const item = items.pop() + if (!item) return cb() + return copyDirItem(items, item, src, dest, opts, cb) +} - return globTasks; +function copyDirItem (items, item, src, dest, opts, cb) { + const srcItem = path.join(src, item) + const destItem = path.join(dest, item) + stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => { + if (err) return cb(err) + const { destStat } = stats + startCopy(destStat, srcItem, destItem, opts, err => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) + }) } -module.exports = function (patterns, opts) { - var globTasks; +function onLink (destStat, src, dest, opts, cb) { + fs.readlink(src, (err, resolvedSrc) => { + if (err) return cb(err) + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc) + } - try { - globTasks = generateGlobTasks(patterns, opts); - } catch (err) { - return Promise.reject(err); - } + if (!destStat) { + return fs.symlink(resolvedSrc, dest, cb) + } else { + fs.readlink(dest, (err, resolvedDest) => { + if (err) { + // dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) + return cb(err) + } + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest) + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) + } - return Promise.all(globTasks.map(function (task) { - return globP(task.pattern, task.opts); - })).then(function (paths) { - return arrayUnion.apply(null, paths); - }); -}; + // do not copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) + } + return copyLink(resolvedSrc, dest, cb) + }) + } + }) +} -module.exports.sync = function (patterns, opts) { - var globTasks = generateGlobTasks(patterns, opts); +function copyLink (resolvedSrc, dest, cb) { + fs.unlink(dest, err => { + if (err) return cb(err) + return fs.symlink(resolvedSrc, dest, cb) + }) +} - return globTasks.reduce(function (matches, task) { - return arrayUnion(matches, glob.sync(task.pattern, task.opts)); - }, []); -}; +module.exports = copy -module.exports.generateGlobTasks = generateGlobTasks; -module.exports.hasMagic = function (patterns, opts) { - return [].concat(patterns).some(function (pattern) { - return glob.hasMagic(pattern, opts); - }); -}; +/***/ }), +/***/ 11647: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +"use strict"; -/***/ 75362: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var _fs -try { - _fs = __webpack_require__(82161) -} catch (_) { - _fs = __webpack_require__(35747) +const u = __nccwpck_require__(92178).fromCallback +module.exports = { + copy: u(__nccwpck_require__(41132)) } -function readFile (file, options, callback) { - if (callback == null) { - callback = options - options = {} - } - if (typeof options === 'string') { - options = {encoding: options} - } +/***/ }), - options = options || {} - var fs = options.fs || _fs +/***/ 81896: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var shouldThrow = true - if ('throws' in options) { - shouldThrow = options.throws - } +"use strict"; - fs.readFile(file, options, function (err, data) { - if (err) return callback(err) - data = stripBom(data) +const u = __nccwpck_require__(92178).fromCallback +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(81881) +const remove = __nccwpck_require__(71703) - var obj - try { - obj = JSON.parse(data, options ? options.reviver : null) - } catch (err2) { - if (shouldThrow) { - err2.message = file + ': ' + err2.message - return callback(err2) - } else { - return callback(null, null) - } +const emptyDir = u(function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(item => path.join(dir, item)) + + deleteItem() + + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) } + }) +}) - callback(null, obj) +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) }) } -function readFileSync (file, options) { - options = options || {} - if (typeof options === 'string') { - options = {encoding: options} - } +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} - var fs = options.fs || _fs - var shouldThrow = true - if ('throws' in options) { - shouldThrow = options.throws - } +/***/ }), - try { - var content = fs.readFileSync(file, options) - content = stripBom(content) - return JSON.parse(content, options.reviver) - } catch (err) { - if (shouldThrow) { - err.message = file + ': ' + err.message - throw err - } else { - return null - } - } -} +/***/ 6039: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function stringify (obj, options) { - var spaces - var EOL = '\n' - if (typeof options === 'object' && options !== null) { - if (options.spaces) { - spaces = options.spaces - } - if (options.EOL) { - EOL = options.EOL - } +"use strict"; + + +const u = __nccwpck_require__(92178).fromCallback +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const mkdir = __nccwpck_require__(81881) + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) } - var str = JSON.stringify(obj, options ? options.replacer : null, spaces) + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + fs.stat(dir, (err, stats) => { + if (err) { + // if the directory doesn't exist, make it + if (err.code === 'ENOENT') { + return mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + } + return callback(err) + } - return str.replace(/\n/g, EOL) + EOL + if (stats.isDirectory()) makeFile() + else { + // parent is not a directory + // This is just to cause an internal ENOTDIR error to be thrown + fs.readdir(dir, err => { + if (err) return callback(err) + }) + } + }) + }) } -function writeFile (file, obj, options, callback) { - if (callback == null) { - callback = options - options = {} - } - options = options || {} - var fs = options.fs || _fs +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch {} + if (stats && stats.isFile()) return - var str = '' + const dir = path.dirname(file) try { - str = stringify(obj, options) + if (!fs.statSync(dir).isDirectory()) { + // parent is not a directory + // This is just to cause an internal ENOTDIR error to be thrown + fs.readdirSync(dir) + } } catch (err) { - // Need to return whether a callback was passed or not - if (callback) callback(err, null) - return + // If the stat call above failed because the directory doesn't exist, create it + if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir) + else throw err } - fs.writeFile(file, str, options, callback) -} - -function writeFileSync (file, obj, options) { - options = options || {} - var fs = options.fs || _fs - - var str = stringify(obj, options) - // not sure if fs.writeFileSync returns anything, but just in case - return fs.writeFileSync(file, str, options) -} - -function stripBom (content) { - // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified - if (Buffer.isBuffer(content)) content = content.toString('utf8') - content = content.replace(/^\uFEFF/, '') - return content + fs.writeFileSync(file, '') } -var jsonfile = { - readFile: readFile, - readFileSync: readFileSync, - writeFile: writeFile, - writeFileSync: writeFileSync +module.exports = { + createFile: u(createFile), + createFileSync } -module.exports = jsonfile - /***/ }), -/***/ 39160: -/***/ ((module) => { +/***/ 60151: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var processFn = function (fn, P, opts) { - return function () { - var that = this; - var args = new Array(arguments.length); +const file = __nccwpck_require__(6039) +const link = __nccwpck_require__(55914) +const symlink = __nccwpck_require__(98894) - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} - return new P(function (resolve, reject) { - args.push(function (err, result) { - if (err) { - reject(err); - } else if (opts.multiArgs) { - var results = new Array(arguments.length - 1); - for (var i = 1; i < arguments.length; i++) { - results[i - 1] = arguments[i]; - } +/***/ }), - resolve(results); - } else { - resolve(result); - } - }); +/***/ 55914: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - fn.apply(that, args); - }); - }; -}; +"use strict"; -var pify = module.exports = function (obj, P, opts) { - if (typeof P !== 'function') { - opts = P; - P = Promise; - } - opts = opts || {}; - opts.exclude = opts.exclude || [/.+Sync$/]; +const u = __nccwpck_require__(92178).fromCallback +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const mkdir = __nccwpck_require__(81881) +const pathExists = __nccwpck_require__(42176).pathExists - var filter = function (key) { - var match = function (pattern) { - return typeof pattern === 'string' ? key === pattern : pattern.test(key); - }; +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } - return opts.include ? opts.include.some(match) : !opts.exclude.some(match); - }; + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } - var ret = typeof obj === 'function' ? function () { - if (opts.excludeMain) { - return obj.apply(this, arguments); - } + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} - return processFn(obj, P, opts).apply(this, arguments); - } : {}; +function createLinkSync (srcpath, dstpath) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined - return Object.keys(obj).reduce(function (ret, key) { - var x = obj[key]; + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } - ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) - return ret; - }, ret); -}; + return fs.linkSync(srcpath, dstpath) +} -pify.all = pify; +module.exports = { + createLink: u(createLink), + createLinkSync +} /***/ }), -/***/ 8989: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 68917: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __webpack_require__(85622); -const findUp = __webpack_require__(2885); -const pkgDir = async cwd => { - const filePath = await findUp('package.json', {cwd}); - return filePath && path.dirname(filePath); -}; +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const pathExists = __nccwpck_require__(42176).pathExists -module.exports = pkgDir; -// TODO: Remove this for the next major release -module.exports.default = pkgDir; +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ -module.exports.sync = cwd => { - const filePath = findUp.sync('package.json', {cwd}); - return filePath && path.dirname(filePath); -}; +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + toCwd: srcpath, + toDst: srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + toCwd: relativeToDst, + toDst: srcpath + }) + } else { + return fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + toCwd: srcpath, + toDst: srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + toCwd: relativeToDst, + toDst: srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} /***/ }), -/***/ 57258: -/***/ ((__unused_webpack_module, exports) => { +/***/ 19358: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -exports.E = function (fn) { - return Object.defineProperty(function () { - if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) - else { - return new Promise((resolve, reject) => { - arguments[arguments.length] = (err, res) => { - if (err) return reject(err) - resolve(res) - } - arguments.length++ - fn.apply(this, arguments) - }) - } - }, 'name', { value: fn.name }) +const fs = __nccwpck_require__(82161) + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) } -exports.p = function (fn) { - return Object.defineProperty(function () { - const cb = arguments[arguments.length - 1] - if (typeof cb !== 'function') return fn.apply(this, arguments) - else fn.apply(this, arguments).then(r => cb(null, r), cb) - }, 'name', { value: fn.name }) +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync } /***/ }), -/***/ 30357: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ 98894: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored +"use strict"; -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} -var path = __webpack_require__(85622) -var minimatch = __webpack_require__(26944) -var isAbsolute = __webpack_require__(36540) -var Minimatch = minimatch.Minimatch +const u = __nccwpck_require__(92178).fromCallback +const path = __nccwpck_require__(85622) +const fs = __nccwpck_require__(82161) +const _mkdirs = __nccwpck_require__(81881) +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} +const _symlinkPaths = __nccwpck_require__(68917) +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync -function alphasort (a, b) { - return a.localeCompare(b) -} +const _symlinkType = __nccwpck_require__(19358) +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync -function setupIgnores (self, options) { - self.ignore = options.ignore || [] +const pathExists = __nccwpck_require__(42176).pathExists - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) } -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } +function createSymlinkSync (srcpath, dstpath, type) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) } -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - setupIgnores(self, options) +/***/ }), - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } +/***/ 82998: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") +"use strict"; - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = __nccwpck_require__(92178).fromCallback +const fs = __nccwpck_require__(82161) - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchmod', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'opendir', + 'readdir', + 'readFile', + 'readlink', + 'realpath', + 'rename', + 'rm', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.opendir was added in Node.js v12.12.0 + // fs.rm was added in Node.js v14.14.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} +// Export all keys: +Object.keys(fs).forEach(key => { + if (key === 'promises') { + // fs.promises is a getter property that triggers ExperimentalWarning + // Don't re-export it here, the getter is defined in "lib/index.js" + return + } + exports[key] = fs[key] +}) -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) +// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) }) - - self.found = all + }) } -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// We need to handle both cases, so we use ...args +exports.write = function (fd, buffer, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.write(fd, buffer, ...args) + } - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) + return new Promise((resolve, reject) => { + fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] +// fs.writev only available in Node v12.9.0+ +if (typeof fs.writev === 'function') { + // Function signature is + // s.writev(fd, buffers[, position], callback) + // We need to handle the optional arg, so we use ...args + exports.writev = function (fd, buffers, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.writev(fd, buffers, ...args) } + + return new Promise((resolve, reject) => { + fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { + if (err) return reject(err) + resolve({ bytesWritten, buffers }) + }) + }) } +} - return m +// fs.realpath.native only available in Node v9.2+ +if (typeof fs.realpath.native === 'function') { + exports.realpath.native = u(fs.realpath.native) } -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') +/***/ }), - return abs -} +/***/ 66272: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) +module.exports = { + // Export promiseified graceful-fs: + ...__nccwpck_require__(82998), + // Export extra methods: + ...__nccwpck_require__(6574), + ...__nccwpck_require__(11647), + ...__nccwpck_require__(81896), + ...__nccwpck_require__(60151), + ...__nccwpck_require__(16047), + ...__nccwpck_require__(81881), + ...__nccwpck_require__(58611), + ...__nccwpck_require__(96489), + ...__nccwpck_require__(81192), + ...__nccwpck_require__(42176), + ...__nccwpck_require__(71703) } -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) +// Export fs.promises as a getter property so that we don't trigger +// ExperimentalWarning before fs.promises is actually accessed. +const fs = __nccwpck_require__(35747) +if (Object.getOwnPropertyDescriptor(fs, 'promises')) { + Object.defineProperty(module.exports, "promises", ({ + get () { return fs.promises } + })) } /***/ }), -/***/ 37966: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 16047: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. +"use strict"; -module.exports = glob -var fs = __webpack_require__(35747) -var rp = __webpack_require__(54082) -var minimatch = __webpack_require__(26944) -var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(2989) -var EE = __webpack_require__(28614).EventEmitter -var path = __webpack_require__(85622) -var assert = __webpack_require__(42357) -var isAbsolute = __webpack_require__(36540) -var globSync = __webpack_require__(28427) -var common = __webpack_require__(30357) -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = __webpack_require__(94889) -var util = __webpack_require__(31669) -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored +const u = __nccwpck_require__(92178).fromPromise +const jsonFile = __nccwpck_require__(53118) + +jsonFile.outputJson = u(__nccwpck_require__(80690)) +jsonFile.outputJsonSync = __nccwpck_require__(66704) +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync -var once = __webpack_require__(96754) +module.exports = jsonFile -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } +/***/ }), - return new Glob(pattern, options, cb) -} +/***/ 53118: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync +"use strict"; -// old api surface -glob.glob = glob -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } +const jsonFile = __nccwpck_require__(91393) - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin +module.exports = { + // jsonfile exports + readJson: jsonFile.readFile, + readJsonSync: jsonFile.readFileSync, + writeJson: jsonFile.writeFile, + writeJsonSync: jsonFile.writeFileSync } -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - var g = new Glob(pattern, options) - var set = g.minimatch.set +/***/ }), - if (!pattern) - return false +/***/ 66704: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (set.length > 1) - return true +"use strict"; - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - return false +const { stringify } = __nccwpck_require__(24401) +const { outputFileSync } = __nccwpck_require__(81192) + +function outputJsonSync (file, data, options) { + const str = stringify(data, options) + + outputFileSync(file, str, options) } -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } +module.exports = outputJsonSync - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) +/***/ }), - setopts(this, pattern, options) - this._didRealPath = false +/***/ 80690: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // process each pattern in the minimatch set - var n = this.minimatch.set.length +"use strict"; - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } +const { stringify } = __nccwpck_require__(24401) +const { outputFile } = __nccwpck_require__(81192) - var self = this - this._processing = 0 +async function outputJson (file, data, options = {}) { + const str = stringify(data, options) - this._emitQueue = [] - this._processQueue = [] - this.paused = false + await outputFile(file, str, options) +} - if (this.noprocess) - return this +module.exports = outputJson - if (n === 0) - return done() - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false +/***/ }), - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} +/***/ 81881: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return +"use strict"; - if (this.realpath && !this._didRealpath) - return this._realpath() +const u = __nccwpck_require__(92178).fromPromise +const { makeDir: _makeDir, makeDirSync } = __nccwpck_require__(970) +const makeDir = u(_makeDir) - common.finish(this) - this.emit('end', this.found) +module.exports = { + mkdirs: makeDir, + mkdirsSync: makeDirSync, + // alias + mkdirp: makeDir, + mkdirpSync: makeDirSync, + ensureDir: makeDir, + ensureDirSync: makeDirSync } -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - this._didRealpath = true +/***/ }), - var n = this.matches.length - if (n === 0) - return this._finish() +/***/ 970: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) +"use strict"; +// Adapted from https://github.com/sindresorhus/make-dir +// Copyright (c) Sindre Sorhus (sindresorhus.com) +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - function next () { - if (--n === 0) - self._finish() +const fs = __nccwpck_require__(82998) +const path = __nccwpck_require__(85622) +const atLeastNode = __nccwpck_require__(898) + +const useNativeRecursiveOption = atLeastNode('10.12.0') + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const checkPath = pth => { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')) + + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`) + error.code = 'EINVAL' + throw error + } } } -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() +const processOptions = options => { + const defaults = { mode: 0o777 } + if (typeof options === 'number') options = { mode: options } + return { ...defaults, ...options } +} - var found = Object.keys(matchset) - var self = this - var n = found.length +const permissionError = pth => { + // This replicates the exception of `fs.mkdir` with native the + // `recusive` option when run on an invalid drive under Windows. + const error = new Error(`operation not permitted, mkdir '${pth}'`) + error.code = 'EPERM' + error.errno = -4048 + error.path = pth + error.syscall = 'mkdir' + return error +} - if (n === 0) - return cb() +module.exports.makeDir = async (input, options) => { + checkPath(input) + options = processOptions(options) - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here + if (useNativeRecursiveOption) { + const pth = path.resolve(input) - if (--n === 0) { - self.matches[index] = set - cb() - } + return fs.mkdir(pth, { + mode: options.mode, + recursive: true }) - }) -} + } -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} + const make = async pth => { + try { + await fs.mkdir(pth, options.mode) + } catch (error) { + if (error.code === 'EPERM') { + throw error + } -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth) + } -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} + if (error.message.includes('null bytes')) { + throw error + } -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') + await make(path.dirname(pth)) + return make(pth) + } + + try { + const stats = await fs.stat(pth) + if (!stats.isDirectory()) { + // This error is never exposed to the user + // it is caught below, and the original error is thrown + throw new Error('The path is not a directory') + } + } catch { + throw error + } + } } + + return make(path.resolve(input)) } -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) +module.exports.makeDirSync = (input, options) => { + checkPath(input) + options = processOptions(options) + + if (useNativeRecursiveOption) { + const pth = path.resolve(input) + + return fs.mkdirSync(pth, { + mode: options.mode, + recursive: true + }) + } + + const make = pth => { + try { + fs.mkdirSync(pth, options.mode) + } catch (error) { + if (error.code === 'EPERM') { + throw error } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) + + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth) + } + + if (error.message.includes('null bytes')) { + throw error + } + + make(path.dirname(pth)) + return make(pth) + } + + try { + if (!fs.statSync(pth).isDirectory()) { + // This error is never exposed to the user + // it is caught below, and the original error is thrown + throw new Error('The path is not a directory') + } + } catch { + throw error } } } + + return make(path.resolve(input)) } -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - if (this.aborted) - return +/***/ }), - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } +/***/ 58611: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - //console.error('PROCESS %d', this._processing, pattern) +"use strict"; - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return +module.exports = { + moveSync: __nccwpck_require__(18178) +} - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } +/***/ }), - var remain = pattern.slice(n) +/***/ 18178: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix +"use strict"; - var abs = this._makeAbs(read) - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const copySync = __nccwpck_require__(6574).copySync +const removeSync = __nccwpck_require__(71703).removeSync +const mkdirpSync = __nccwpck_require__(81881).mkdirpSync +const stat = __nccwpck_require__(66834) - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} +function moveSync (src, dest, opts) { + opts = opts || {} + const overwrite = opts.overwrite || opts.clobber || false -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) + const { srcStat } = stat.checkPathsSync(src, dest, 'move') + stat.checkParentPathsSync(src, srcStat, dest, 'move') + mkdirpSync(path.dirname(dest)) + return doRename(src, dest, overwrite) } -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() +function doRename (src, dest, overwrite) { + if (overwrite) { + removeSync(dest) + return rename(src, dest, overwrite) + } + if (fs.existsSync(dest)) throw new Error('dest already exists.') + return rename(src, dest, overwrite) +} - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' +function rename (src, dest, overwrite) { + try { + fs.renameSync(src, dest) + } catch (err) { + if (err.code !== 'EXDEV') throw err + return moveAcrossDevice(src, dest, overwrite) + } +} - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } +function moveAcrossDevice (src, dest, overwrite) { + const opts = { + overwrite, + errorOnExist: true } + copySync(src, dest, opts) + return removeSync(src) +} - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) +module.exports = moveSync - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. +/***/ }), - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) +/***/ 96489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } +"use strict"; - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() +const u = __nccwpck_require__(92178).fromCallback +module.exports = { + move: u(__nccwpck_require__(71294)) } -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - if (isIgnored(this, e)) - return +/***/ }), - if (this.paused) { - this._emitQueue.push([index, e]) - return +/***/ 71294: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const copy = __nccwpck_require__(11647).copy +const remove = __nccwpck_require__(71703).remove +const mkdirp = __nccwpck_require__(81881).mkdirp +const pathExists = __nccwpck_require__(42176).pathExists +const stat = __nccwpck_require__(66834) + +function move (src, dest, opts, cb) { + if (typeof opts === 'function') { + cb = opts + opts = {} } - var abs = isAbsolute(e) ? e : this._makeAbs(e) + const overwrite = opts.overwrite || opts.clobber || false - if (this.mark) - e = this._mark(e) + stat.checkPaths(src, dest, 'move', (err, stats) => { + if (err) return cb(err) + const { srcStat } = stats + stat.checkParentPaths(src, srcStat, dest, 'move', err => { + if (err) return cb(err) + mkdirp(path.dirname(dest), err => { + if (err) return cb(err) + return doRename(src, dest, overwrite, cb) + }) + }) + }) +} - if (this.absolute) - e = abs +function doRename (src, dest, overwrite, cb) { + if (overwrite) { + return remove(dest, err => { + if (err) return cb(err) + return rename(src, dest, overwrite, cb) + }) + } + pathExists(dest, (err, destExists) => { + if (err) return cb(err) + if (destExists) return cb(new Error('dest already exists.')) + return rename(src, dest, overwrite, cb) + }) +} - if (this.matches[index][e]) - return +function rename (src, dest, overwrite, cb) { + fs.rename(src, dest, err => { + if (!err) return cb() + if (err.code !== 'EXDEV') return cb(err) + return moveAcrossDevice(src, dest, overwrite, cb) + }) +} - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return +function moveAcrossDevice (src, dest, overwrite, cb) { + const opts = { + overwrite, + errorOnExist: true } + copy(src, dest, opts, err => { + if (err) return cb(err) + return remove(src, cb) + }) +} - this.matches[index][e] = true +module.exports = move - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - this.emit('match', e) -} +/***/ }), -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return +/***/ 81192: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) +"use strict"; - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - if (lstatcb) - fs.lstat(abs, lstatcb) +const u = __nccwpck_require__(92178).fromCallback +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const mkdir = __nccwpck_require__(81881) +const pathExists = __nccwpck_require__(42176).pathExists - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, ...args) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync(file, ...args) } + mkdir.mkdirsSync(dir) + fs.writeFileSync(file, ...args) } -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return +module.exports = { + outputFile: u(outputFile), + outputFileSync +} - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) +/***/ }), - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() +/***/ 42176: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (Array.isArray(c)) - return cb(null, c) - } +"use strict"; - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) +const u = __nccwpck_require__(92178).fromPromise +const fs = __nccwpck_require__(82998) + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) } -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync } -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } +/***/ }), - this.cache[abs] = entries - return cb(null, entries) +/***/ 71703: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const u = __nccwpck_require__(92178).fromCallback +const rimraf = __nccwpck_require__(90065) + +module.exports = { + remove: u(rimraf), + removeSync: rimraf.sync } -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break +/***/ }), - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break +/***/ 90065: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } +"use strict"; - return cb() -} -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) +const fs = __nccwpck_require__(82161) +const path = __nccwpck_require__(85622) +const assert = __nccwpck_require__(42357) + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] }) + + options.maxBusyTries = options.maxBusyTries || 3 } +function rimraf (p, options, cb) { + let busyTries = 0 -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) + if (typeof options === 'function') { + cb = options + options = {} + } - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() + assert(p, 'rimraf: missing path') + assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') + assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) + defaults(options) - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + const time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } - var isSym = this.symlinks[abs] - var len = entries.length + // already gone + if (er.code === 'ENOENT') er = null + } - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() + cb(er) + }) +} - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } - cb() + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) } -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } }) } -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - //console.error('ps2', prefix, exists) +function fixWinEPERMSync (p, options, er) { + let stats - if (!this.matches[index]) - this.matches[index] = Object.create(null) + assert(p) + assert(options) - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' + throw er } } - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} - // Mark this as a match - this._emitMatch(index, prefix) - cb() +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) } -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') - if (f.length > this.maxLength) - return cb() + options.readdir(p, (er, files) => { + if (er) return cb(er) - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] + let n = files.length + let errState - if (Array.isArray(c)) - c = 'DIR' + if (n === 0) return options.rmdir(p, cb) - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} - if (needDir && c === 'FILE') - return cb() +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } + options = options || {} + defaults(options) - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) + assert(p, 'rimraf: missing path') + assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return } - } - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) } else { - self._stat2(f, abs, er, lstat, cb) + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er } + rmdirSync(p, options, er) } } -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } + } +} - if (needDir && c === 'FILE') - return cb() +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - return cb(null, c, stat) + if (isWindows) { + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const startTime = Date.now() + do { + try { + const ret = options.rmdirSync(p, options) + return ret + } catch {} + } while (Date.now() - startTime < 500) // give up after 500ms + } else { + const ret = options.rmdirSync(p, options) + return ret + } } +module.exports = rimraf +rimraf.sync = rimrafSync -/***/ }), - -/***/ 28427: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -module.exports = globSync -globSync.GlobSync = GlobSync +/***/ }), -var fs = __webpack_require__(35747) -var rp = __webpack_require__(54082) -var minimatch = __webpack_require__(26944) -var Minimatch = minimatch.Minimatch -var Glob = __webpack_require__(37966).Glob -var util = __webpack_require__(31669) -var path = __webpack_require__(85622) -var assert = __webpack_require__(42357) -var isAbsolute = __webpack_require__(36540) -var common = __webpack_require__(30357) -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored +/***/ 66834: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') +"use strict"; - return new GlobSync(pattern, options).found -} -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') +const fs = __nccwpck_require__(82998) +const path = __nccwpck_require__(85622) +const util = __nccwpck_require__(31669) +const atLeastNode = __nccwpck_require__(898) - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') +const nodeSupportsBigInt = atLeastNode('10.5.0') +const stat = (file) => nodeSupportsBigInt ? fs.stat(file, { bigint: true }) : fs.stat(file) +const statSync = (file) => nodeSupportsBigInt ? fs.statSync(file, { bigint: true }) : fs.statSync(file) - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) +function getStats (src, dest) { + return Promise.all([ + stat(src), + stat(dest).catch(err => { + if (err.code === 'ENOENT') return null + throw err + }) + ]).then(([srcStat, destStat]) => ({ srcStat, destStat })) +} - setopts(this, pattern, options) +function getStatsSync (src, dest) { + let destStat + const srcStat = statSync(src) + try { + destStat = statSync(dest) + } catch (err) { + if (err.code === 'ENOENT') return { srcStat, destStat: null } + throw err + } + return { srcStat, destStat } +} - if (this.noprocess) - return this +function checkPaths (src, dest, funcName, cb) { + util.callbackify(getStats)(src, dest, (err, stats) => { + if (err) return cb(err) + const { srcStat, destStat } = stats + if (destStat && areIdentical(srcStat, destStat)) { + return cb(new Error('Source and destination must not be the same.')) + } + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + return cb(new Error(errMsg(src, dest, funcName))) + } + return cb(null, { srcStat, destStat }) + }) +} - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) +function checkPathsSync (src, dest, funcName) { + const { srcStat, destStat } = getStatsSync(src, dest) + if (destStat && areIdentical(srcStat, destStat)) { + throw new Error('Source and destination must not be the same.') } - this._finish() + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new Error(errMsg(src, dest, funcName)) + } + return { srcStat, destStat } } -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) +// recursively check if dest parent is a subdirectory of src. +// It works for all file types including symlinks since it +// checks the src and dest inodes. It starts from the deepest +// parent and stops once it reaches the src parent or the root path. +function checkParentPaths (src, srcStat, dest, funcName, cb) { + const srcParent = path.resolve(path.dirname(src)) + const destParent = path.resolve(path.dirname(dest)) + if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() + const callback = (err, destStat) => { + if (err) { + if (err.code === 'ENOENT') return cb() + return cb(err) + } + if (areIdentical(srcStat, destStat)) { + return cb(new Error(errMsg(src, dest, funcName))) + } + return checkParentPaths(src, srcStat, destParent, funcName, cb) } - common.finish(this) + if (nodeSupportsBigInt) fs.stat(destParent, { bigint: true }, callback) + else fs.stat(destParent, callback) } - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ +function checkParentPathsSync (src, srcStat, dest, funcName) { + const srcParent = path.resolve(path.dirname(src)) + const destParent = path.resolve(path.dirname(dest)) + if (destParent === srcParent || destParent === path.parse(destParent).root) return + let destStat + try { + destStat = statSync(destParent) + } catch (err) { + if (err.code === 'ENOENT') return + throw err } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break + if (areIdentical(srcStat, destStat)) { + throw new Error(errMsg(src, dest, funcName)) } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) + return checkParentPathsSync(src, srcStat, destParent, funcName) } - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) +function areIdentical (srcStat, destStat) { + if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) { + if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) { + // definitive answer + return true + } + // Use additional heuristics if we can't use 'bigint'. + // Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER + // See issue 657 + if (destStat.size === srcStat.size && + destStat.mode === srcStat.mode && + destStat.nlink === srcStat.nlink && + destStat.atimeMs === srcStat.atimeMs && + destStat.mtimeMs === srcStat.mtimeMs && + destStat.ctimeMs === srcStat.ctimeMs && + destStat.birthtimeMs === srcStat.birthtimeMs) { + // heuristic answer + return true } } + return false +} - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return +// return true if dest is a subdir of src, otherwise false. +// It only checks the path strings. +function isSrcSubdir (src, dest) { + const srcArr = path.resolve(src).split(path.sep).filter(i => i) + const destArr = path.resolve(dest).split(path.sep).filter(i => i) + return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) +} - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. +function errMsg (src, dest, funcName) { + return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` +} - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) +module.exports = { + checkPaths, + checkPathsSync, + checkParentPaths, + checkParentPathsSync, + isSrcSubdir +} - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } +/***/ }), - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} +/***/ 64698: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - var abs = this._makeAbs(e) +const fs = __nccwpck_require__(82161) - if (this.mark) - e = this._mark(e) +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} - if (this.absolute) { - e = abs - } +function utimesMillisSync (path, atime, mtime) { + const fd = fs.openSync(path, 'r+') + fs.futimesSync(fd, atime, mtime) + return fs.closeSync(fd) +} - if (this.matches[index][e]) - return +module.exports = { + utimesMillis, + utimesMillisSync +} - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - this.matches[index][e] = true +/***/ }), - if (this.stat) - this._stat(e) -} +/***/ 16252: +/***/ ((module) => { +"use strict"; -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); } - } + var args = slice.call(arguments, 1); - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } - return entries -} + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) + return bound; +}; - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - if (Array.isArray(c)) - return c - } +/***/ }), - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} +/***/ 45489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } +"use strict"; - this.cache[abs] = entries - // mark and cache dir-ness - return entries -} +var implementation = __nccwpck_require__(16252); -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break +module.exports = Function.prototype.bind || implementation; - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} +/***/ }), -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { +/***/ 5882: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var entries = this._readdir(abs, inGlobStar) +"use strict"; - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return +const {PassThrough: PassThroughStream} = __nccwpck_require__(92413); - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) +module.exports = options => { + options = {...options}; - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) + const {array} = options; + let {encoding} = options; + const isBuffer = encoding === 'buffer'; + let objectMode = false; - var len = entries.length - var isSym = this.symlinks[abs] + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || 'utf8'; + } - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return + if (isBuffer) { + encoding = null; + } - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue + const stream = new PassThroughStream({objectMode}); - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) + if (encoding) { + stream.setEncoding(encoding); + } - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} + let length = 0; + const chunks = []; -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) + stream.on('data', chunk => { + chunks.push(chunk); - if (!this.matches[index]) - this.matches[index] = Object.create(null) + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); - // If it doesn't exist, then just mark the lack of results - if (!exists) - return + stream.getBufferedValue = () => { + if (array) { + return chunks; + } - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); + }; - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') + stream.getBufferedLength = () => length; - // Mark this as a match - this._emitMatch(index, prefix) -} + return stream; +}; -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - if (f.length > this.maxLength) - return false +/***/ }), - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] +/***/ 63886: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (Array.isArray(c)) - c = 'DIR' +"use strict"; - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c +const {constants: BufferConstants} = __nccwpck_require__(64293); +const pump = __nccwpck_require__(20113); +const bufferStream = __nccwpck_require__(5882); - if (needDir && c === 'FILE') - return false +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } +async function getStream(inputStream, options) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } + options = { + maxBuffer: Infinity, + ...options + }; - if (lstat && lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } + const {maxBuffer} = options; - this.statCache[abs] = stat + let stream; + await new Promise((resolve, reject) => { + const rejectPromise = error => { + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error.bufferedData = stream.getBufferedValue(); + } - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' + reject(error); + }; - this.cache[abs] = this.cache[abs] || c + stream = pump(inputStream, bufferStream(options), error => { + if (error) { + rejectPromise(error); + return; + } - if (needDir && c === 'FILE') - return false + resolve(); + }); - return c -} + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) + return stream.getBufferedValue(); } -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} +module.exports = getStream; +// TODO: Remove this for the next major release +module.exports.default = getStream; +module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); +module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); +module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 76609: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63258,7 +49572,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _roarr = _interopRequireDefault(__webpack_require__(30786)); +var _roarr = _interopRequireDefault(__nccwpck_require__(30786)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63273,7 +49587,7 @@ exports.default = _default; /***/ }), /***/ 72652: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63283,9 +49597,11 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _serializeError = __webpack_require__(81224); +var _serializeError = __nccwpck_require__(81224); + +var _boolean = __nccwpck_require__(8436); -var _Logger = _interopRequireDefault(__webpack_require__(76609)); +var _Logger = _interopRequireDefault(__nccwpck_require__(76609)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63366,8 +49682,45 @@ class Agent { const connectionConfiguration = { host: configuration.hostname || configuration.host, port: configuration.port || 80, - proxy - }; // $FlowFixMe It appears that Flow is missing the method description. + proxy, + tls: {} + }; // add optional tls options for https requests. + // @see https://nodejs.org/docs/latest-v12.x/api/https.html#https_https_request_url_options_callback : + // > The following additional options from tls.connect() + // > - https://nodejs.org/docs/latest-v12.x/api/tls.html#tls_tls_connect_options_callback - + // > are also accepted: + // > ca, cert, ciphers, clientCertEngine, crl, dhparam, ecdhCurve, honorCipherOrder, + // > key, passphrase, pfx, rejectUnauthorized, secureOptions, secureProtocol, servername, sessionIdContext. + + if (this.protocol === 'https:') { + connectionConfiguration.tls = { + ca: configuration.ca, + cert: configuration.cert, + ciphers: configuration.ciphers, + clientCertEngine: configuration.clientCertEngine, + crl: configuration.crl, + dhparam: configuration.dhparam, + ecdhCurve: configuration.ecdhCurve, + honorCipherOrder: configuration.honorCipherOrder, + key: configuration.key, + passphrase: configuration.passphrase, + pfx: configuration.pfx, + rejectUnauthorized: configuration.rejectUnauthorized, + secureOptions: configuration.secureOptions, + secureProtocol: configuration.secureProtocol, + servername: configuration.servername || connectionConfiguration.host, + sessionIdContext: configuration.sessionIdContext + }; // This is not ideal because there is no way to override this setting using `tls` configuration if `NODE_TLS_REJECT_UNAUTHORIZED=0`. + // However, popular HTTP clients (such as https://github.com/sindresorhus/got) come with pre-configured value for `rejectUnauthorized`, + // which makes it impossible to override that value globally and respect `rejectUnauthorized` for specific requests only. + // + // eslint-disable-next-line no-process-env + + if (typeof process.env.NODE_TLS_REJECT_UNAUTHORIZED === 'string' && (0, _boolean.boolean)(process.env.NODE_TLS_REJECT_UNAUTHORIZED) === false) { + connectionConfiguration.tls.rejectUnauthorized = false; + } + } // $FlowFixMe It appears that Flow is missing the method description. + this.createConnection(connectionConfiguration, (error, socket) => { log.trace({ @@ -63415,7 +49768,7 @@ exports.default = _default; /***/ }), /***/ 73946: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63425,9 +49778,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _net = _interopRequireDefault(__webpack_require__(11631)); +var _net = _interopRequireDefault(__nccwpck_require__(11631)); -var _Agent = _interopRequireDefault(__webpack_require__(72652)); +var _Agent = _interopRequireDefault(__nccwpck_require__(72652)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63455,7 +49808,7 @@ exports.default = _default; /***/ }), /***/ 18272: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63465,11 +49818,11 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _net = _interopRequireDefault(__webpack_require__(11631)); +var _net = _interopRequireDefault(__nccwpck_require__(11631)); -var _tls = _interopRequireDefault(__webpack_require__(4016)); +var _tls = _interopRequireDefault(__nccwpck_require__(4016)); -var _Agent = _interopRequireDefault(__webpack_require__(72652)); +var _Agent = _interopRequireDefault(__nccwpck_require__(72652)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63488,9 +49841,7 @@ class HttpsProxyAgent extends _Agent.default { callback(error); }); socket.once('data', () => { - const secureSocket = _tls.default.connect({ - rejectUnauthorized: false, - servername: configuration.host, + const secureSocket = _tls.default.connect({ ...configuration.tls, socket }); @@ -63517,7 +49868,7 @@ exports.default = _default; /***/ }), /***/ 1725: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63544,11 +49895,11 @@ Object.defineProperty(exports, "HttpsProxyAgent", ({ } })); -var _Agent = _interopRequireDefault(__webpack_require__(72652)); +var _Agent = _interopRequireDefault(__nccwpck_require__(72652)); -var _HttpProxyAgent = _interopRequireDefault(__webpack_require__(73946)); +var _HttpProxyAgent = _interopRequireDefault(__nccwpck_require__(73946)); -var _HttpsProxyAgent = _interopRequireDefault(__webpack_require__(18272)); +var _HttpsProxyAgent = _interopRequireDefault(__nccwpck_require__(18272)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -63556,7 +49907,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 988: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63566,7 +49917,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.UnexpectedStateError = void 0; -var _es6Error = _interopRequireDefault(__webpack_require__(65393)); +var _es6Error = _interopRequireDefault(__nccwpck_require__(65393)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63585,7 +49936,7 @@ exports.UnexpectedStateError = UnexpectedStateError; /***/ }), /***/ 67165: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63595,23 +49946,23 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _http = _interopRequireDefault(__webpack_require__(98605)); +var _http = _interopRequireDefault(__nccwpck_require__(98605)); -var _https = _interopRequireDefault(__webpack_require__(57211)); +var _https = _interopRequireDefault(__nccwpck_require__(57211)); -var _boolean = __webpack_require__(8436); +var _boolean = __nccwpck_require__(8436); -var _semver = _interopRequireDefault(__webpack_require__(19618)); +var _semver = _interopRequireDefault(__nccwpck_require__(19618)); -var _Logger = _interopRequireDefault(__webpack_require__(76609)); +var _Logger = _interopRequireDefault(__nccwpck_require__(76609)); -var _classes = __webpack_require__(1725); +var _classes = __nccwpck_require__(1725); -var _errors = __webpack_require__(988); +var _errors = __nccwpck_require__(988); -var _utilities = __webpack_require__(33846); +var _utilities = __nccwpck_require__(33846); -var _createProxyController = _interopRequireDefault(__webpack_require__(55581)); +var _createProxyController = _interopRequireDefault(__nccwpck_require__(55581)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63651,7 +50002,7 @@ const createConfiguration = configurationInput => { const defaultConfiguration = { environmentVariableNamespace: typeof environment.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE === 'string' ? environment.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE : 'GLOBAL_AGENT_', forceGlobalAgent: typeof environment.GLOBAL_AGENT_FORCE_GLOBAL_AGENT === 'string' ? (0, _boolean.boolean)(environment.GLOBAL_AGENT_FORCE_GLOBAL_AGENT) : true, - socketConnectionTimeout: typeof environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT === 'string' ? parseInt(environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT, 10) : defaultConfigurationInput.socketConnectionTimeout + socketConnectionTimeout: typeof environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT === 'string' ? Number.parseInt(environment.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT, 10) : defaultConfigurationInput.socketConnectionTimeout }; // $FlowFixMe return { ...defaultConfiguration, @@ -63767,7 +50118,7 @@ exports.default = _default; /***/ }), /***/ 55581: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63777,7 +50128,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _Logger = _interopRequireDefault(__webpack_require__(76609)); +var _Logger = _interopRequireDefault(__nccwpck_require__(76609)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63819,7 +50170,7 @@ exports.default = _default; /***/ }), /***/ 459: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63840,9 +50191,9 @@ Object.defineProperty(exports, "createProxyController", ({ } })); -var _createGlobalProxyAgent = _interopRequireDefault(__webpack_require__(67165)); +var _createGlobalProxyAgent = _interopRequireDefault(__nccwpck_require__(67165)); -var _createProxyController = _interopRequireDefault(__webpack_require__(55581)); +var _createProxyController = _interopRequireDefault(__nccwpck_require__(55581)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -63850,7 +50201,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 22407: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; var __webpack_unused_export__; @@ -63872,15 +50223,15 @@ __webpack_unused_export__ = ({ } }); -var _routines = __webpack_require__(52934); +var _routines = __nccwpck_require__(52934); -var _factories = __webpack_require__(459); +var _factories = __nccwpck_require__(459); //# sourceMappingURL=index.js.map /***/ }), /***/ 63187: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63890,9 +50241,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _Logger = _interopRequireDefault(__webpack_require__(76609)); +var _Logger = _interopRequireDefault(__nccwpck_require__(76609)); -var _factories = __webpack_require__(459); +var _factories = __nccwpck_require__(459); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -63917,7 +50268,7 @@ exports.default = _default; /***/ }), /***/ 52934: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63932,7 +50283,7 @@ Object.defineProperty(exports, "bootstrap", ({ } })); -var _bootstrap = _interopRequireDefault(__webpack_require__(63187)); +var _bootstrap = _interopRequireDefault(__nccwpck_require__(63187)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -63940,7 +50291,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 26269: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -63950,9 +50301,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _http = _interopRequireDefault(__webpack_require__(98605)); +var _http = _interopRequireDefault(__nccwpck_require__(98605)); -var _https = _interopRequireDefault(__webpack_require__(57211)); +var _https = _interopRequireDefault(__nccwpck_require__(57211)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -64009,7 +50360,7 @@ exports.default = _default; /***/ }), /***/ 33846: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -64036,11 +50387,11 @@ Object.defineProperty(exports, "parseProxyUrl", ({ } })); -var _bindHttpMethod = _interopRequireDefault(__webpack_require__(26269)); +var _bindHttpMethod = _interopRequireDefault(__nccwpck_require__(26269)); -var _isUrlMatchingNoProxy = _interopRequireDefault(__webpack_require__(3075)); +var _isUrlMatchingNoProxy = _interopRequireDefault(__nccwpck_require__(3075)); -var _parseProxyUrl = _interopRequireDefault(__webpack_require__(12514)); +var _parseProxyUrl = _interopRequireDefault(__nccwpck_require__(12514)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -64048,7 +50399,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 3075: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -64058,17 +50409,17 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _url = __webpack_require__(78835); +var _url = __nccwpck_require__(78835); -var _matcher = _interopRequireDefault(__webpack_require__(89437)); +var _matcher = _interopRequireDefault(__nccwpck_require__(89437)); -var _errors = __webpack_require__(988); +var _errors = __nccwpck_require__(988); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const isUrlMatchingNoProxy = (subjectUrl, noProxy) => { const subjectUrlTokens = (0, _url.parse)(subjectUrl); - const rules = noProxy.split(/[,\s]/); + const rules = noProxy.split(/[\s,]/); for (const rule of rules) { const ruleMatch = rule.replace(/^(?\.)/, '*').match(/^(?.+?)(?::(?\d+))?$/); @@ -64098,7 +50449,7 @@ exports.default = _default; /***/ }), /***/ 12514: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -64108,9 +50459,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _url = __webpack_require__(78835); +var _url = __nccwpck_require__(78835); -var _errors = __webpack_require__(988); +var _errors = __nccwpck_require__(988); const parseProxyUrl = url => { const urlTokens = (0, _url.parse)(url); @@ -64130,7 +50481,7 @@ const parseProxyUrl = url => { let port = 80; if (urlTokens.port) { - port = parseInt(urlTokens.port, 10); + port = Number.parseInt(urlTokens.port, 10); } return { @@ -64147,7 +50498,7 @@ exports.default = _default; /***/ }), /***/ 2667: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* jshint node:true */ @@ -64159,19 +50510,19 @@ exports.default = _default; var globalTunnel = exports; exports.constructor = function() {}; -var http = __webpack_require__(98605); -var https = __webpack_require__(57211); -var urlParse = __webpack_require__(78835).parse; -var urlStringify = __webpack_require__(78835).format; +var http = __nccwpck_require__(98605); +var https = __nccwpck_require__(57211); +var urlParse = __nccwpck_require__(78835).parse; +var urlStringify = __nccwpck_require__(78835).format; -var pick = __webpack_require__(53651); -var assign = __webpack_require__(66690); -var clone = __webpack_require__(31471); -var tunnel = __webpack_require__(57951); -var npmConfig = __webpack_require__(8569); -var encodeUrl = __webpack_require__(33874); +var pick = __nccwpck_require__(53651); +var assign = __nccwpck_require__(66690); +var clone = __nccwpck_require__(31471); +var tunnel = __nccwpck_require__(57951); +var npmConfig = __nccwpck_require__(8569); +var encodeUrl = __nccwpck_require__(33874); -var agents = __webpack_require__(34); +var agents = __nccwpck_require__(34); exports.agents = agents; var ENV_VAR_PROXY_SEARCH_ORDER = [ @@ -64503,19 +50854,19 @@ globalTunnel.end = function() { /***/ }), /***/ 34: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* jshint node:true */ -var util = __webpack_require__(31669); -var http = __webpack_require__(98605); +var util = __nccwpck_require__(31669); +var http = __nccwpck_require__(98605); var HttpAgent = http.Agent; -var https = __webpack_require__(57211); +var https = __nccwpck_require__(57211); var HttpsAgent = https.Agent; -var pick = __webpack_require__(53651); +var pick = __nccwpck_require__(53651); /** * Proxy some traffic over HTTP. @@ -64574,16 +50925,16 @@ module.exports = global; /***/ }), /***/ 35553: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var defineProperties = __webpack_require__(47778); +var defineProperties = __nccwpck_require__(47778); -var implementation = __webpack_require__(60531); -var getPolyfill = __webpack_require__(75854); -var shim = __webpack_require__(96303); +var implementation = __nccwpck_require__(60531); +var getPolyfill = __nccwpck_require__(75854); +var shim = __nccwpck_require__(96303); var polyfill = getPolyfill(); @@ -64601,12 +50952,12 @@ module.exports = getGlobal; /***/ }), /***/ 75854: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var implementation = __webpack_require__(60531); +var implementation = __nccwpck_require__(60531); module.exports = function getPolyfill() { if (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) { @@ -64619,13 +50970,13 @@ module.exports = function getPolyfill() { /***/ }), /***/ 96303: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var define = __webpack_require__(47778); -var getPolyfill = __webpack_require__(75854); +var define = __nccwpck_require__(47778); +var getPolyfill = __nccwpck_require__(75854); module.exports = function shimGlobal() { var polyfill = getPolyfill(); @@ -64649,11 +51000,11 @@ module.exports = function shimGlobal() { /***/ }), /***/ 83205: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {PassThrough} = __webpack_require__(92413); +const {PassThrough} = __nccwpck_require__(92413); module.exports = options => { options = Object.assign({}, options); @@ -64708,12 +51059,12 @@ module.exports = options => { /***/ }), /***/ 43141: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pump = __webpack_require__(20113); -const bufferStream = __webpack_require__(83205); +const pump = __nccwpck_require__(20113); +const bufferStream = __nccwpck_require__(83205); class MaxBufferError extends Error { constructor() { @@ -64766,18 +51117,18 @@ module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 59427: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const EventEmitter = __webpack_require__(28614); -const getStream = __webpack_require__(43141); -const is = __webpack_require__(24120); -const PCancelable = __webpack_require__(76348); -const requestAsEventEmitter = __webpack_require__(81406); -const {HTTPError, ParseError, ReadError} = __webpack_require__(21751); -const {options: mergeOptions} = __webpack_require__(34119); -const {reNormalize} = __webpack_require__(85277); +const EventEmitter = __nccwpck_require__(28614); +const getStream = __nccwpck_require__(43141); +const is = __nccwpck_require__(24120); +const PCancelable = __nccwpck_require__(76348); +const requestAsEventEmitter = __nccwpck_require__(81406); +const {HTTPError, ParseError, ReadError} = __nccwpck_require__(21751); +const {options: mergeOptions} = __nccwpck_require__(34119); +const {reNormalize} = __nccwpck_require__(85277); const asPromise = options => { const proxy = new EventEmitter(); @@ -64882,14 +51233,14 @@ module.exports = asPromise; /***/ }), /***/ 40919: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {PassThrough} = __webpack_require__(92413); -const duplexer3 = __webpack_require__(71257); -const requestAsEventEmitter = __webpack_require__(81406); -const {HTTPError, ReadError} = __webpack_require__(21751); +const {PassThrough} = __nccwpck_require__(92413); +const duplexer3 = __nccwpck_require__(71257); +const requestAsEventEmitter = __nccwpck_require__(81406); +const {HTTPError, ReadError} = __nccwpck_require__(21751); module.exports = options => { const input = new PassThrough(); @@ -64983,16 +51334,16 @@ module.exports = options => { /***/ }), /***/ 4094: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const errors = __webpack_require__(21751); -const asStream = __webpack_require__(40919); -const asPromise = __webpack_require__(59427); -const normalizeArguments = __webpack_require__(85277); -const merge = __webpack_require__(34119); -const deepFreeze = __webpack_require__(69734); +const errors = __nccwpck_require__(21751); +const asStream = __nccwpck_require__(40919); +const asPromise = __nccwpck_require__(59427); +const normalizeArguments = __nccwpck_require__(85277); +const merge = __nccwpck_require__(34119); +const deepFreeze = __nccwpck_require__(69734); const getPromiseOrStream = options => options.stream ? asStream(options) : asPromise(options); @@ -65070,14 +51421,14 @@ module.exports = create; /***/ }), /***/ 21751: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const urlLib = __webpack_require__(78835); -const http = __webpack_require__(98605); -const PCancelable = __webpack_require__(76348); -const is = __webpack_require__(24120); +const urlLib = __nccwpck_require__(78835); +const http = __nccwpck_require__(98605); +const PCancelable = __nccwpck_require__(76348); +const is = __nccwpck_require__(24120); class GotError extends Error { constructor(message, error, options) { @@ -65185,14 +51536,14 @@ module.exports.CancelError = PCancelable.CancelError; /***/ }), /***/ 76023: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const decompressResponse = __webpack_require__(47781); -const is = __webpack_require__(24120); -const mimicResponse = __webpack_require__(27480); -const progress = __webpack_require__(24368); +const decompressResponse = __nccwpck_require__(47781); +const is = __nccwpck_require__(24120); +const mimicResponse = __nccwpck_require__(27480); +const progress = __nccwpck_require__(24368); module.exports = (response, options, emitter) => { const downloadBodySize = Number(response.headers['content-length']) || null; @@ -65224,12 +51575,12 @@ module.exports = (response, options, emitter) => { /***/ }), /***/ 2673: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pkg = __webpack_require__(66256); -const create = __webpack_require__(4094); +const pkg = __nccwpck_require__(66256); +const create = __nccwpck_require__(4094); const defaults = { options: { @@ -65310,13 +51661,13 @@ module.exports = [ /***/ }), /***/ 34119: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {URL} = __webpack_require__(78835); -const is = __webpack_require__(24120); -const knownHookEvents = __webpack_require__(38589); +const {URL} = __nccwpck_require__(78835); +const is = __nccwpck_require__(24120); +const knownHookEvents = __nccwpck_require__(38589); const merge = (target, ...sources) => { for (const source of sources) { @@ -65391,19 +51742,19 @@ module.exports.instances = mergeInstances; /***/ }), /***/ 85277: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {URL, URLSearchParams} = __webpack_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 -const urlLib = __webpack_require__(78835); -const is = __webpack_require__(24120); -const urlParseLax = __webpack_require__(83530); -const lowercaseKeys = __webpack_require__(18984); -const urlToOptions = __webpack_require__(13674); -const isFormData = __webpack_require__(34908); -const merge = __webpack_require__(34119); -const knownHookEvents = __webpack_require__(38589); +const {URL, URLSearchParams} = __nccwpck_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 +const urlLib = __nccwpck_require__(78835); +const is = __nccwpck_require__(24120); +const urlParseLax = __nccwpck_require__(83530); +const lowercaseKeys = __nccwpck_require__(18984); +const urlToOptions = __nccwpck_require__(13674); +const isFormData = __nccwpck_require__(34908); +const merge = __nccwpck_require__(34119); +const knownHookEvents = __nccwpck_require__(38589); const retryAfterStatusCodes = new Set([413, 429, 503]); @@ -65664,11 +52015,11 @@ module.exports.reNormalize = reNormalize; /***/ }), /***/ 24368: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {Transform} = __webpack_require__(92413); +const {Transform} = __nccwpck_require__(92413); module.exports = { download(response, emitter, downloadBodySize) { @@ -65768,26 +52119,26 @@ module.exports = { /***/ }), /***/ 81406: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const {URL} = __webpack_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 -const util = __webpack_require__(31669); -const EventEmitter = __webpack_require__(28614); -const http = __webpack_require__(98605); -const https = __webpack_require__(57211); -const urlLib = __webpack_require__(78835); -const CacheableRequest = __webpack_require__(78837); -const toReadableStream = __webpack_require__(40081); -const is = __webpack_require__(24120); -const timer = __webpack_require__(8595); -const timedOut = __webpack_require__(92379); -const getBodySize = __webpack_require__(12966); -const getResponse = __webpack_require__(76023); -const progress = __webpack_require__(24368); -const {CacheError, UnsupportedProtocolError, MaxRedirectsError, RequestError, TimeoutError} = __webpack_require__(21751); -const urlToOptions = __webpack_require__(13674); +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const {URL} = __nccwpck_require__(78835); // TODO: Use the `URL` global when targeting Node.js 10 +const util = __nccwpck_require__(31669); +const EventEmitter = __nccwpck_require__(28614); +const http = __nccwpck_require__(98605); +const https = __nccwpck_require__(57211); +const urlLib = __nccwpck_require__(78835); +const CacheableRequest = __nccwpck_require__(78837); +const toReadableStream = __nccwpck_require__(40081); +const is = __nccwpck_require__(24120); +const timer = __nccwpck_require__(8595); +const timedOut = __nccwpck_require__(92379); +const getBodySize = __nccwpck_require__(12966); +const getResponse = __nccwpck_require__(76023); +const progress = __nccwpck_require__(24368); +const {CacheError, UnsupportedProtocolError, MaxRedirectsError, RequestError, TimeoutError} = __nccwpck_require__(21751); +const urlToOptions = __nccwpck_require__(13674); const getMethodRedirectCodes = new Set([300, 301, 302, 303, 304, 305, 307, 308]); const allMethodRedirectCodes = new Set([300, 303, 307, 308]); @@ -66088,11 +52439,11 @@ module.exports = (options, input) => { /***/ }), /***/ 69734: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const is = __webpack_require__(24120); +const is = __nccwpck_require__(24120); module.exports = function deepFreeze(object) { for (const [key, value] of Object.entries(object)) { @@ -66108,14 +52459,14 @@ module.exports = function deepFreeze(object) { /***/ }), /***/ 12966: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const util = __webpack_require__(31669); -const is = __webpack_require__(24120); -const isFormData = __webpack_require__(34908); +const fs = __nccwpck_require__(35747); +const util = __nccwpck_require__(31669); +const is = __nccwpck_require__(24120); +const isFormData = __nccwpck_require__(34908); module.exports = async options => { const {body} = options; @@ -66148,11 +52499,11 @@ module.exports = async options => { /***/ }), /***/ 34908: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const is = __webpack_require__(24120); +const is = __nccwpck_require__(24120); module.exports = body => is.nodeStream(body) && is.function(body.getBoundary); @@ -66160,11 +52511,11 @@ module.exports = body => is.nodeStream(body) && is.function(body.getBoundary); /***/ }), /***/ 92379: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const net = __webpack_require__(11631); +const net = __nccwpck_require__(11631); class TimeoutError extends Error { constructor(threshold, event) { @@ -66328,11 +52679,11 @@ module.exports.TimeoutError = TimeoutError; /***/ }), /***/ 13674: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const is = __webpack_require__(24120); +const is = __nccwpck_require__(24120); module.exports = url => { const options = { @@ -66368,12 +52719,16 @@ module.exports = url => { module.exports = clone +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } + var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) @@ -66388,14 +52743,14 @@ function clone (obj) { /***/ }), /***/ 82161: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __webpack_require__(35747) -var polyfills = __webpack_require__(60034) -var legacy = __webpack_require__(7077) -var clone = __webpack_require__(95581) +var fs = __nccwpck_require__(35747) +var polyfills = __nccwpck_require__(60034) +var legacy = __nccwpck_require__(7077) +var clone = __nccwpck_require__(95581) -var util = __webpack_require__(31669) +var util = __nccwpck_require__(31669) /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue @@ -66476,7 +52831,7 @@ if (!fs[gracefulQueue]) { if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(fs[gracefulQueue]) - __webpack_require__(42357).equal(fs[gracefulQueue].length, 0) + __nccwpck_require__(42357).equal(fs[gracefulQueue].length, 0) }) } } @@ -66562,6 +52917,25 @@ function patch (fs) { } } + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([fs$copyFile, [src, dest, flags, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + var fs$readdir = fs.readdir fs.readdir = readdir function readdir (path, options, cb) { @@ -66749,9 +53123,9 @@ function retry () { /***/ }), /***/ 7077: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Stream = __webpack_require__(92413).Stream +var Stream = __nccwpck_require__(92413).Stream module.exports = legacy @@ -66874,9 +53248,9 @@ function legacy (fs) { /***/ }), /***/ 60034: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var constants = __webpack_require__(27619) +var constants = __nccwpck_require__(27619) var origCwd = process.cwd var cwd = null @@ -66892,10 +53266,14 @@ try { process.cwd() } catch (er) {} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) } module.exports = patch @@ -67010,7 +53388,7 @@ function patch (fs) { } // This ensures `util.promisify` works as it does for native `fs.read`. - read.__proto__ = fs$read + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) @@ -67227,119 +53605,26 @@ function patch (fs) { "use strict"; -module.exports = (flag, argv) => { - argv = argv || process.argv; + +module.exports = (flag, argv = process.argv) => { const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const pos = argv.indexOf(prefix + flag); - const terminatorPos = argv.indexOf('--'); - return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; /***/ }), -/***/ 56530: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var os = __webpack_require__(12087); -if (typeof os.homedir !== 'undefined') { - module.exports = os.homedir; -} else { - module.exports = __webpack_require__(19949); -} - - - -/***/ }), - -/***/ 19949: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 97841: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var fs = __webpack_require__(35747); -var parse = __webpack_require__(43403); - -function homedir() { - // The following logic is from looking at logic used in the different platform - // versions of the uv_os_homedir function found in https://github.com/libuv/libuv - // This is the function used in modern versions of node.js - - if (process.platform === 'win32') { - // check the USERPROFILE first - if (process.env.USERPROFILE) { - return process.env.USERPROFILE; - } - - // check HOMEDRIVE and HOMEPATH - if (process.env.HOMEDRIVE && process.env.HOMEPATH) { - return process.env.HOMEDRIVE + process.env.HOMEPATH; - } - - // fallback to HOME - if (process.env.HOME) { - return process.env.HOME; - } - - return null; - } - - // check HOME environment variable first - if (process.env.HOME) { - return process.env.HOME; - } - - // on linux platforms (including OSX) find the current user and get their homedir from the /etc/passwd file - var passwd = tryReadFileSync('/etc/passwd'); - var home = find(parse(passwd), getuid()); - if (home) { - return home; - } - - // fallback to using user environment variables - var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME; - - if (!user) { - return null; - } - - if (process.platform === 'darwin') { - return '/Users/' + user; - } - - return '/home/' + user; -} - -function find(arr, uid) { - var len = arr.length; - for (var i = 0; i < len; i++) { - if (+arr[i].uid === uid) { - return arr[i].homedir; - } - } -} - -function getuid() { - if (typeof process.geteuid === 'function') { - return process.geteuid(); - } - return process.getuid(); -} - -function tryReadFileSync(fp) { - try { - return fs.readFileSync(fp, 'utf8'); - } catch (err) { - return ''; - } -} - -module.exports = homedir; +var bind = __nccwpck_require__(45489); +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); /***/ }), @@ -67432,11 +53717,11 @@ function formatHashFragment (fragment) { /***/ }), /***/ 13460: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var gitHosts = __webpack_require__(31489) +var gitHosts = __nccwpck_require__(31489) /* eslint-disable node/no-deprecated-api */ // copy-pasta util._extend from node's source, to avoid pulling @@ -67596,13 +53881,13 @@ GitHost.prototype.toString = function (opts) { /***/ }), /***/ 47052: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var url = __webpack_require__(78835) -var gitHosts = __webpack_require__(31489) -var GitHost = module.exports = __webpack_require__(13460) +var url = __nccwpck_require__(78835) +var gitHosts = __nccwpck_require__(31489) +var GitHost = module.exports = __nccwpck_require__(13460) var protocolToRepresentationMap = { 'git+ssh:': 'sshurl', @@ -68713,13 +54998,13 @@ standard:"other"}];exports.SIGNALS=SIGNALS; /***/ }), /***/ 18694: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__webpack_require__(12087); +Object.defineProperty(exports, "__esModule", ({value:true}));exports.signalsByNumber=exports.signalsByName=void 0;var _os=__nccwpck_require__(12087); -var _signals=__webpack_require__(84193); -var _realtime=__webpack_require__(34337); +var _signals=__nccwpck_require__(84193); +var _realtime=__nccwpck_require__(34337); @@ -68817,13 +55102,13 @@ const SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX; /***/ }), /***/ 84193: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__webpack_require__(12087); +Object.defineProperty(exports, "__esModule", ({value:true}));exports.getSignals=void 0;var _os=__nccwpck_require__(12087); -var _core=__webpack_require__(54930); -var _realtime=__webpack_require__(34337); +var _core=__nccwpck_require__(54930); +var _realtime=__nccwpck_require__(34337); @@ -68856,9448 +55141,9342 @@ return{name,number,description,supported,action,forced,standard}; }; //# sourceMappingURL=signals.js.map -/***/ }), - -/***/ 52111: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var normalizeUrl = __webpack_require__(68203); -var stripUrlAuth = __webpack_require__(36889); - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return normalizeUrl(stripUrlAuth(str)).replace(/^(?:https?:)?\/\//, ''); -}; - - -/***/ }), - -/***/ 60131: -/***/ ((module) => { - -"use strict"; - -var toString = Object.prototype.toString; - -module.exports = function (x) { - var prototype; - return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); -}; - - -/***/ }), - -/***/ 68203: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var url = __webpack_require__(78835); -var punycode = __webpack_require__(94213); -var queryString = __webpack_require__(76671); -var prependHttp = __webpack_require__(24375); -var sortKeys = __webpack_require__(12843); -var objectAssign = __webpack_require__(14594); - -var DEFAULT_PORTS = { - 'http:': 80, - 'https:': 443, - 'ftp:': 21 -}; - -// protocols that always contain a `//`` bit -var slashedProtocol = { - 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true -}; - -function testParameter(name, filters) { - return filters.some(function (filter) { - return filter instanceof RegExp ? filter.test(name) : filter === name; - }); -} - -module.exports = function (str, opts) { - opts = objectAssign({ - normalizeProtocol: true, - normalizeHttps: false, - stripFragment: true, - stripWWW: true, - removeQueryParameters: [/^utm_\w+/i], - removeTrailingSlash: true, - removeDirectoryIndex: false - }, opts); - - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - var hasRelativeProtocol = str.indexOf('//') === 0; - - // prepend protocol - str = prependHttp(str.trim()).replace(/^\/\//, 'http://'); - - var urlObj = url.parse(str); - - if (opts.normalizeHttps && urlObj.protocol === 'https:') { - urlObj.protocol = 'http:'; - } - - if (!urlObj.hostname && !urlObj.pathname) { - throw new Error('Invalid URL'); - } - - // prevent these from being used by `url.format` - delete urlObj.host; - delete urlObj.query; - - // remove fragment - if (opts.stripFragment) { - delete urlObj.hash; - } - - // remove default port - var port = DEFAULT_PORTS[urlObj.protocol]; - if (Number(urlObj.port) === port) { - delete urlObj.port; - } - - // remove duplicate slashes - if (urlObj.pathname) { - urlObj.pathname = urlObj.pathname.replace(/\/{2,}/g, '/'); - } - - // decode URI octets - if (urlObj.pathname) { - urlObj.pathname = decodeURI(urlObj.pathname); - } - - // remove directory index - if (opts.removeDirectoryIndex === true) { - opts.removeDirectoryIndex = [/^index\.[a-z]+$/]; - } - - if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length) { - var pathComponents = urlObj.pathname.split('/'); - var lastComponent = pathComponents[pathComponents.length - 1]; - - if (testParameter(lastComponent, opts.removeDirectoryIndex)) { - pathComponents = pathComponents.slice(0, pathComponents.length - 1); - urlObj.pathname = pathComponents.slice(1).join('/') + '/'; - } - } - - // resolve relative paths, but only for slashed protocols - if (slashedProtocol[urlObj.protocol]) { - var domain = urlObj.protocol + '//' + urlObj.hostname; - var relative = url.resolve(domain, urlObj.pathname); - urlObj.pathname = relative.replace(domain, ''); - } - - if (urlObj.hostname) { - // IDN to Unicode - urlObj.hostname = punycode.toUnicode(urlObj.hostname).toLowerCase(); - - // remove trailing dot - urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); - - // remove `www.` - if (opts.stripWWW) { - urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); - } - } - - // remove URL with empty query string - if (urlObj.search === '?') { - delete urlObj.search; - } - - var queryParameters = queryString.parse(urlObj.search); - - // remove query unwanted parameters - if (Array.isArray(opts.removeQueryParameters)) { - for (var key in queryParameters) { - if (testParameter(key, opts.removeQueryParameters)) { - delete queryParameters[key]; - } - } - } - - // sort query parameters - urlObj.search = queryString.stringify(sortKeys(queryParameters)); - - // decode query parameters - urlObj.search = decodeURIComponent(urlObj.search); - - // take advantage of many of the Node `url` normalizations - str = url.format(urlObj); - - // remove ending `/` - if (opts.removeTrailingSlash || urlObj.pathname === '/') { - str = str.replace(/\/$/, ''); - } - - // restore relative protocol, if applicable - if (hasRelativeProtocol && !opts.normalizeProtocol) { - str = str.replace(/^http:\/\//, '//'); - } - - return str; -}; - - -/***/ }), - -/***/ 24375: -/***/ ((module) => { - -"use strict"; - -module.exports = function (url) { - if (typeof url !== 'string') { - throw new TypeError('Expected a string, got ' + typeof url); - } - - url = url.trim(); - - if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { - return url; - } - - return url.replace(/^(?!(?:\w+:)?\/\/)/, 'http://'); -}; - - -/***/ }), - -/***/ 12843: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var isPlainObj = __webpack_require__(60131); - -module.exports = function (obj, opts) { - if (!isPlainObj(obj)) { - throw new TypeError('Expected a plain object'); - } - - opts = opts || {}; - - // DEPRECATED - if (typeof opts === 'function') { - opts = {compare: opts}; - } - - var deep = opts.deep; - var seenInput = []; - var seenOutput = []; - - var sortKeys = function (x) { - var seenIndex = seenInput.indexOf(x); - - if (seenIndex !== -1) { - return seenOutput[seenIndex]; - } - - var ret = {}; - var keys = Object.keys(x).sort(opts.compare); - - seenInput.push(x); - seenOutput.push(ret); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var val = x[key]; - - ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; - } - - return ret; - }; - - return sortKeys(obj); -}; - - -/***/ }), - -/***/ 94889: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var wrappy = __webpack_require__(83640) -var reqs = Object.create(null) -var once = __webpack_require__(96754) - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} - - -/***/ }), - -/***/ 2989: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -try { - var util = __webpack_require__(31669); - /* istanbul ignore next */ - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - /* istanbul ignore next */ - module.exports = __webpack_require__(97350); -} - - -/***/ }), - -/***/ 97350: -/***/ ((module) => { - -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} - - -/***/ }), - -/***/ 27452: -/***/ ((__unused_webpack_module, exports) => { - -exports.parse = exports.decode = decode - -exports.stringify = exports.encode = encode - -exports.safe = safe -exports.unsafe = unsafe - -var eol = typeof process !== 'undefined' && - process.platform === 'win32' ? '\r\n' : '\n' - -function encode (obj, opt) { - var children = [] - var out = '' - - if (typeof opt === 'string') { - opt = { - section: opt, - whitespace: false - } - } else { - opt = opt || {} - opt.whitespace = opt.whitespace === true - } - - var separator = opt.whitespace ? ' = ' : '=' - - Object.keys(obj).forEach(function (k, _, __) { - var val = obj[k] - if (val && Array.isArray(val)) { - val.forEach(function (item) { - out += safe(k + '[]') + separator + safe(item) + '\n' - }) - } else if (val && typeof val === 'object') { - children.push(k) - } else { - out += safe(k) + separator + safe(val) + eol - } - }) - - if (opt.section && out.length) { - out = '[' + safe(opt.section) + ']' + eol + out - } - - children.forEach(function (k, _, __) { - var nk = dotSplit(k).join('\\.') - var section = (opt.section ? opt.section + '.' : '') + nk - var child = encode(obj[k], { - section: section, - whitespace: opt.whitespace - }) - if (out.length && child.length) { - out += eol - } - out += child - }) - - return out -} - -function dotSplit (str) { - return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') - .replace(/\\\./g, '\u0001') - .split(/\./).map(function (part) { - return part.replace(/\1/g, '\\.') - .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') - }) -} - -function decode (str) { - var out = {} - var p = out - var section = null - // section |key = value - var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i - var lines = str.split(/[\r\n]+/g) - - lines.forEach(function (line, _, __) { - if (!line || line.match(/^\s*[;#]/)) return - var match = line.match(re) - if (!match) return - if (match[1] !== undefined) { - section = unsafe(match[1]) - p = out[section] = out[section] || {} - return - } - var key = unsafe(match[2]) - var value = match[3] ? unsafe(match[4]) : true - switch (value) { - case 'true': - case 'false': - case 'null': value = JSON.parse(value) - } - - // Convert keys with '[]' suffix to an array - if (key.length > 2 && key.slice(-2) === '[]') { - key = key.substring(0, key.length - 2) - if (!p[key]) { - p[key] = [] - } else if (!Array.isArray(p[key])) { - p[key] = [p[key]] - } - } +/***/ }), - // safeguard against resetting a previously defined - // array by accidentally forgetting the brackets - if (Array.isArray(p[key])) { - p[key].push(value) - } else { - p[key] = value - } - }) +/***/ 44263: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} - // use a filter to return the keys that have to be deleted. - Object.keys(out).filter(function (k, _, __) { - if (!out[k] || - typeof out[k] !== 'object' || - Array.isArray(out[k])) { - return false - } - // see if the parent section is also an object. - // if so, add it to that, and mark this one for deletion - var parts = dotSplit(k) - var p = out - var l = parts.pop() - var nl = l.replace(/\\\./g, '.') - parts.forEach(function (part, _, __) { - if (!p[part] || typeof p[part] !== 'object') p[part] = {} - p = p[part] - }) - if (p === out && nl === l) { - return false - } - p[nl] = out[k] - return true - }).forEach(function (del, _, __) { - delete out[del] - }) +"use strict"; - return out -} +var Buffer = __nccwpck_require__(52340).Buffer; -function isQuoted (val) { - return (val.charAt(0) === '"' && val.slice(-1) === '"') || - (val.charAt(0) === "'" && val.slice(-1) === "'") -} +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. -function safe (val) { - return (typeof val !== 'string' || - val.match(/[=\r\n]/) || - val.match(/^\[/) || - (val.length > 1 && - isQuoted(val)) || - val !== val.trim()) - ? JSON.stringify(val) - : val.replace(/;/g, '\\;').replace(/#/g, '\\#') -} +exports._dbcs = DBCSCodec; -function unsafe (val, doUnesc) { - val = (val || '').trim() - if (isQuoted(val)) { - // remove the single quotes before calling JSON.parse - if (val.charAt(0) === "'") { - val = val.substr(1, val.length - 2) - } - try { val = JSON.parse(val) } catch (_) {} - } else { - // walk the val to find the first not-escaped ; character - var esc = false - var unesc = '' - for (var i = 0, l = val.length; i < l; i++) { - var c = val.charAt(i) - if (esc) { - if ('\\;#'.indexOf(c) !== -1) { - unesc += c - } else { - unesc += '\\' + c - } - esc = false - } else if (';#'.indexOf(c) !== -1) { - break - } else if (c === '\\') { - esc = true - } else { - unesc += c - } - } - if (esc) { - unesc += '\\' - } - return unesc.trim() - } - return val -} +var UNASSIGNED = -1, + GB18030_CODE = -2, + SEQ_START = -10, + NODE_START = -1000, + UNASSIGNED_NODE = new Array(0x100), + DEF_CHAR = -1; +for (var i = 0; i < 0x100; i++) + UNASSIGNED_NODE[i] = UNASSIGNED; -/***/ }), -/***/ 30237: -/***/ ((module) => { +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data.") + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); -"use strict"; + // Load tables. + var mappingTable = codecOptions.table(); -module.exports = function isArrayish(obj) { - if (!obj) { - return false; - } + // Decode tables: MBCS -> Unicode. - return obj instanceof Array || Array.isArray(obj) || - (obj.length >= 0 && obj.splice instanceof Function); -}; + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = []; -/***/ }), + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) + this._addDecodeChunk(mappingTable[i]); -/***/ 53966: -/***/ ((module) => { + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. -/*! - * is-extglob - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); -module.exports = function isExtglob(str) { - if (typeof str !== 'string' || str === '') { - return false; - } + var commonFourthByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); - var match; - while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { - if (match[2]) return true; - str = str.slice(match.index + match[0].length); - } + // Fill out the tree + var firstByteNode = this.decodeTables[0]; + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2"); + } - return false; -}; + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue; + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3"); + } + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) + fourthByteNode[l] = GB18030_CODE; + } + } + } + } + } -/***/ }), + this.defaultCharUnicode = iconv.defaultCharUnicode; -/***/ 2182: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + + // Encode tables: Unicode -> DBCS. -/*! - * is-glob - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = []; + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = []; -var isExtglob = __webpack_require__(53966); -var chars = { '{': '}', '(': ')', '[': ']'}; -var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; -var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i]; + if (typeof val === 'number') + skipEncodeChars[val] = true; + else + for (var j = val.from; j <= val.to; j++) + skipEncodeChars[j] = true; + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars); -module.exports = function isGlob(str, options) { - if (typeof str !== 'string' || str === '') { - return false; - } + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); + } - if (isExtglob(str)) { - return true; - } + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); +} - var regex = strictRegex; - var match; +DBCSCodec.prototype.encoder = DBCSEncoder; +DBCSCodec.prototype.decoder = DBCSDecoder; - // optionally relax regex - if (options && options.strict === false) { - regex = relaxedRegex; - } +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>>= 8) + bytes.push(addr & 0xFF); + if (bytes.length == 0) + bytes.push(0); - while ((match = regex.exec(str))) { - if (match[2]) return true; - var idx = match.index + match[0].length; + var node = this.decodeTables[0]; + for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]]; - // if an open bracket/brace/paren is escaped, - // set the index to the next closing character - var open = match[1]; - var close = open ? chars[open] : null; - if (open && close) { - var n = str.indexOf(close, idx); - if (n !== -1) { - idx = n + 1; - } + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } + else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val]; + } + else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); } + return node; +} - str = str.slice(idx); - } - return false; -}; +DBCSCodec.prototype._addDecodeChunk = function(chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16); -/***/ }), + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 0xFF; -/***/ 47133: -/***/ ((module) => { + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k]; + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++); + if (0xD800 <= code && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++); + if (0xDC00 <= codeTrail && codeTrail < 0xE000) + writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } + else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2; + var seq = []; + for (var m = 0; m < len; m++) + seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. -"use strict"; + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); + } + else + writeTable[curAddr++] = code; // Basic char + } + } + else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1; + for (var l = 0; l < part; l++) + writeTable[curAddr++] = charCode++; + } + else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); + } + if (curAddr > 0xFF) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); +} +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. + return this.encodeTable[high]; +} -module.exports = ({stream = process.stdout} = {}) => { - return Boolean( - stream && stream.isTTY && - process.env.TERM !== 'dumb' && - !('CI' in process.env) - ); -}; +DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; +} +DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; -/***/ }), + var node; + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START-bucket[low]]; + } + else { + // There was no sequence object - allocate a new one. + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); + } -/***/ 93458: -/***/ ((module) => { + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length-1; j++) { + var oldVal = node[uCode]; + if (typeof oldVal === 'object') + node = oldVal; + else { + node = node[uCode] = {} + if (oldVal !== undefined) + node[DEF_CHAR] = oldVal + } + } -"use strict"; + // Set the leaf to given dbcsCode. + uCode = seq[seq.length-1]; + node[uCode] = dbcsCode; +} +DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + var hasValues = false; + var subNodeEmpty = {}; + for (var i = 0; i < 0x100; i++) { + var uCode = node[i]; + var mbCode = prefix + i; + if (skipEncodeChars[mbCode]) + continue; -const isStream = stream => - stream !== null && - typeof stream === 'object' && - typeof stream.pipe === 'function'; + if (uCode >= 0) { + this._setEncodeChar(uCode, mbCode); + hasValues = true; + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode; + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) + hasValues = true; + else + subNodeEmpty[subNodeIdx] = true; + } + } else if (uCode <= SEQ_START) { + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + hasValues = true; + } + } + return hasValues; +} -isStream.writable = stream => - isStream(stream) && - stream.writable !== false && - typeof stream._write === 'function' && - typeof stream._writableState === 'object'; -isStream.readable = stream => - isStream(stream) && - stream.readable !== false && - typeof stream._read === 'function' && - typeof stream._readableState === 'object'; -isStream.duplex = stream => - isStream.writable(stream) && - isStream.readable(stream); +// == Encoder ================================================================== -isStream.transform = stream => - isStream.duplex(stream) && - typeof stream._transform === 'function' && - typeof stream._transformState === 'object'; +function DBCSEncoder(options, codec) { + // Encoder state + this.leadSurrogate = -1; + this.seqObj = undefined; + + // Static data + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; +} -module.exports = isStream; +DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), + leadSurrogate = this.leadSurrogate, + seqObj = this.seqObj, nextChar = -1, + i = 0, j = 0; + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break; + var uCode = str.charCodeAt(i++); + } + else { + var uCode = nextChar; + nextChar = -1; + } -/***/ }), + // 1. Handle surrogates. + if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + // Double lead surrogate found. + uCode = UNASSIGNED; + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); + leadSurrogate = -1; + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED; + } + + } + } + else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. + leadSurrogate = -1; + } -/***/ 99333: -/***/ ((module, exports) => { + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED; + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode]; + if (typeof resCode === 'object') { // Sequence continues. + seqObj = resCode; + continue; -/*! - * is-windows - * - * Copyright © 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ + } else if (typeof resCode == 'number') { // Sequence finished. Write it. + dbcsCode = resCode; + + } else if (resCode == undefined) { // Current character is not part of the sequence. -(function(factory) { - if (exports && typeof exports === 'object' && "object" !== 'undefined') { - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { - define([], factory); - } else if (typeof window !== 'undefined') { - window.isWindows = factory(); - } else if (typeof global !== 'undefined') { - global.isWindows = factory(); - } else if (typeof self !== 'undefined') { - self.isWindows = factory(); - } else { - this.isWindows = factory(); - } -})(function() { - 'use strict'; - return function isWindows() { - return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)); - }; -}); + // Try default character for this sequence + resCode = seqObj[DEF_CHAR]; + if (resCode !== undefined) { + dbcsCode = resCode; // Found. Write it. + nextChar = uCode; // Current character will be written too in the next iteration. + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined; + } + else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== undefined) + dbcsCode = subtable[uCode & 0xFF]; + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; + continue; + } -/***/ }), + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; + newBuf[j++] = 0x30 + dbcsCode; + continue; + } + } + } -/***/ 52607: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + else if (dbcsCode < 0x1000000) { + newBuf[j++] = dbcsCode >> 16; + newBuf[j++] = (dbcsCode >> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } else { + newBuf[j++] = dbcsCode >>> 24; + newBuf[j++] = (dbcsCode >>> 16) & 0xFF; + newBuf[j++] = (dbcsCode >>> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } + } -var fs = __webpack_require__(35747) -var core -if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = __webpack_require__(59750) -} else { - core = __webpack_require__(37821) + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j); } -module.exports = isexe -isexe.sync = sync - -function isexe (path, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } +DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === undefined) + return; // All clean. Most often case. - if (!cb) { - if (typeof Promise !== 'function') { - throw new TypeError('callback not provided') - } + var newBuf = Buffer.alloc(10), j = 0; - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er) + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } } else { - resolve(is) + // See todo above. } - }) - }) - } - - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === 'EACCES' || options && options.ignoreErrors) { - er = null - is = false - } + this.seqObj = undefined; } - cb(er, is) - }) -} -function sync (path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}) - } catch (er) { - if (options && options.ignoreErrors || er.code === 'EACCES') { - return false - } else { - throw er + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; } - } + + return newBuf.slice(0, j); } +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx; -/***/ }), - -/***/ 37821: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = isexe -isexe.sync = sync - -var fs = __webpack_require__(35747) -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)) - }) -} +// == Decoder ================================================================== -function sync (path, options) { - return checkStat(fs.statSync(path), options) -} +function DBCSDecoder(options, codec) { + // Decoder state + this.nodeIdx = 0; + this.prevBytes = []; -function checkStat (stat, options) { - return stat.isFile() && checkMode(stat, options) + // Static data + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; } -function checkMode (stat, options) { - var mod = stat.mode - var uid = stat.uid - var gid = stat.gid - - var myUid = options.uid !== undefined ? - options.uid : process.getuid && process.getuid() - var myGid = options.gid !== undefined ? - options.gid : process.getgid && process.getgid() +DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, + prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, + seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. + uCode; - var u = parseInt('100', 8) - var g = parseInt('010', 8) - var o = parseInt('001', 8) - var ug = u | g + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; - var ret = (mod & o) || - (mod & g) && gid === myGid || - (mod & u) && uid === myUid || - (mod & ug) && myUid === 0 + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte]; - return ret -} + if (uCode >= 0) { + // Normal character, just use it. + } + else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + uCode = this.defaultCharUnicode.charCodeAt(0); + i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + } + else if (uCode === GB18030_CODE) { + if (i >= 3) { + var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); + } else { + var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + + (curByte-0x30); + } + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } + else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode; + continue; + } + else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k]; + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + } + uCode = seq[seq.length-1]; + } + else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode >= 0x10000) { + uCode -= 0x10000; + var uCodeLead = 0xD800 | (uCode >> 10); + newBuf[j++] = uCodeLead & 0xFF; + newBuf[j++] = uCodeLead >> 8; -/***/ }), + uCode = 0xDC00 | (uCode & 0x3FF); + } + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; -/***/ 59750: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // Reset trie node. + nodeIdx = 0; seqStart = i+1; + } -module.exports = isexe -isexe.sync = sync + this.nodeIdx = nodeIdx; + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); -var fs = __webpack_require__(35747) + return newBuf.slice(0, j).toString('ucs2'); +} -function checkPathExt (path, options) { - var pathext = options.pathExt !== undefined ? - options.pathExt : process.env.PATHEXT +DBCSDecoder.prototype.end = function() { + var ret = ''; - if (!pathext) { - return true - } + // Try to parse all remaining chars. + while (this.prevBytes.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode; + var bytesArr = this.prevBytes.slice(1); - pathext = pathext.split(';') - if (pathext.indexOf('') !== -1) { - return true - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase() - if (p && path.substr(-p.length).toLowerCase() === p) { - return true + // Parse remaining as usual. + this.prevBytes = []; + this.nodeIdx = 0; + if (bytesArr.length > 0) + ret += this.write(bytesArr); } - } - return false -} -function checkStat (stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false - } - return checkPathExt(path, options) + this.prevBytes = []; + this.nodeIdx = 0; + return ret; } -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)) - }) -} +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx(table, val) { + if (table[0] > val) + return -1; -function sync (path, options) { - return checkStat(fs.statSync(path), path, options) + var l = 0, r = table.length; + while (l < r-1) { // always table[l] <= val < table[r] + var mid = l + ((r-l+1) >> 1); + if (table[mid] <= val) + l = mid; + else + r = mid; + } + return l; } + /***/ }), -/***/ 52388: -/***/ ((__unused_webpack_module, exports) => { +/***/ 14638: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell -// License: MIT. (See LICENSE.) +"use strict"; -Object.defineProperty(exports, "__esModule", ({ - value: true -})) -// This regex comes from regex.coffee, and is inserted here by generate-index.js -// (run `npm run build`). -exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. -exports.matchToToken = function(match) { - var token = {type: "invalid", value: match[0], closed: undefined} - if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) - else if (match[ 5]) token.type = "comment" - else if (match[ 6]) token.type = "comment", token.closed = !!match[7] - else if (match[ 8]) token.type = "regex" - else if (match[ 9]) token.type = "number" - else if (match[10]) token.type = "name" - else if (match[11]) token.type = "punctuator" - else if (match[12]) token.type = "whitespace" - return token -} +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html -/***/ }), + 'shiftjis': { + type: '_dbcs', + table: function() { return __nccwpck_require__(8075) }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + encodeSkipVals: [{from: 0xED40, to: 0xF940}], + }, + 'csshiftjis': 'shiftjis', + 'mskanji': 'shiftjis', + 'sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'ms31j': 'shiftjis', + 'xsjis': 'shiftjis', + 'windows932': 'shiftjis', + 'ms932': 'shiftjis', + '932': 'shiftjis', + 'cp932': 'shiftjis', -/***/ 75337: -/***/ ((__unused_webpack_module, exports) => { + 'eucjp': { + type: '_dbcs', + table: function() { return __nccwpck_require__(84777) }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + }, -//TODO: handle reviver/dehydrate function like normal -//and handle indentation, like normal. -//if anyone needs this... please send pull request. + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. -exports.stringify = function stringify (o) { - if('undefined' == typeof o) return o - if(o && Buffer.isBuffer(o)) - return JSON.stringify(':base64:' + o.toString('base64')) + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder - if(o && o.toJSON) - o = o.toJSON() + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + 'gb2312': 'cp936', + 'gb231280': 'cp936', + 'gb23121980': 'cp936', + 'csgb2312': 'cp936', + 'csiso58gb231280': 'cp936', + 'euccn': 'cp936', - if(o && 'object' === typeof o) { - var s = '' - var array = Array.isArray(o) - s = array ? '[' : '{' - var first = true + // Microsoft's CP936 is a subset and approximation of GBK. + 'windows936': 'cp936', + 'ms936': 'cp936', + '936': 'cp936', + 'cp936': { + type: '_dbcs', + table: function() { return __nccwpck_require__(1351) }, + }, - for(var k in o) { - var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k]) - if(Object.hasOwnProperty.call(o, k) && !ignore) { - if(!first) - s += ',' - first = false - if (array) { - if(o[k] == undefined) - s += 'null' - else - s += stringify(o[k]) - } else if (o[k] !== void(0)) { - s += stringify(k) + ':' + stringify(o[k]) - } - } - } + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + 'gbk': { + type: '_dbcs', + table: function() { return __nccwpck_require__(1351).concat(__nccwpck_require__(17559)) }, + }, + 'xgbk': 'gbk', + 'isoir58': 'gbk', - s += array ? ']' : '}' + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + 'gb18030': { + type: '_dbcs', + table: function() { return __nccwpck_require__(1351).concat(__nccwpck_require__(17559)) }, + gb18030: function() { return __nccwpck_require__(9630) }, + encodeSkipVals: [0x80], + encodeAdd: {'€': 0xA2E3}, + }, - return s - } else if ('string' === typeof o) { - return JSON.stringify(/^:/.test(o) ? ':' + o : o) - } else if ('undefined' === typeof o) { - return 'null'; - } else - return JSON.stringify(o) -} + 'chinese': 'gb18030', -exports.parse = function (s) { - return JSON.parse(s, function (key, value) { - if('string' === typeof value) { - if(/^:base64:/.test(value)) - return new Buffer(value.substring(8), 'base64') - else - return /^:/.test(value) ? value.substring(1) : value - } - return value - }) -} + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + 'windows949': 'cp949', + 'ms949': 'cp949', + '949': 'cp949', + 'cp949': { + type: '_dbcs', + table: function() { return __nccwpck_require__(86401) }, + }, + + 'cseuckr': 'cp949', + 'csksc56011987': 'cp949', + 'euckr': 'cp949', + 'isoir149': 'cp949', + 'korean': 'cp949', + 'ksc56011987': 'cp949', + 'ksc56011989': 'cp949', + 'ksc5601': 'cp949', -/***/ }), -/***/ 48335: -/***/ ((module) => { + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. -"use strict"; + 'windows950': 'cp950', + 'ms950': 'cp950', + '950': 'cp950', + 'cp950': { + type: '_dbcs', + table: function() { return __nccwpck_require__(23940) }, + }, + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + 'big5': 'big5hkscs', + 'big5hkscs': { + type: '_dbcs', + table: function() { return __nccwpck_require__(23940).concat(__nccwpck_require__(52777)) }, + encodeSkipVals: [0xa2cc], + }, -module.exports = parseJson -function parseJson (txt, reviver, context) { - context = context || 20 - try { - return JSON.parse(txt, reviver) - } catch (e) { - if (typeof txt !== 'string') { - const isEmptyArray = Array.isArray(txt) && txt.length === 0 - const errorMessage = 'Cannot parse ' + - (isEmptyArray ? 'an empty array' : String(txt)) - throw new TypeError(errorMessage) - } - const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i) - const errIdx = syntaxErr - ? +syntaxErr[1] - : e.message.match(/^Unexpected end of JSON.*/i) - ? txt.length - 1 - : null - if (errIdx != null) { - const start = errIdx <= context - ? 0 - : errIdx - context - const end = errIdx + context >= txt.length - ? txt.length - : errIdx + context - e.message += ` while parsing near '${ - start === 0 ? '' : '...' - }${txt.slice(start, end)}${ - end === txt.length ? '' : '...' - }'` - } else { - e.message += ` while parsing '${txt.slice(0, context * 2)}'` - } - throw e - } -} + 'cnbig5': 'big5hkscs', + 'csbig5': 'big5hkscs', + 'xxbig5': 'big5hkscs', +}; /***/ }), -/***/ 4211: -/***/ ((module, exports) => { - -exports = module.exports = stringify -exports.getSerialize = serializer - -function stringify(obj, replacer, spaces, cycleReplacer) { - return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) -} +/***/ 62228: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function serializer(replacer, cycleReplacer) { - var stack = [], keys = [] +"use strict"; - if (cycleReplacer == null) cycleReplacer = function(key, value) { - if (stack[0] === value) return "[Circular ~]" - return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" - } - return function(key, value) { - if (stack.length > 0) { - var thisPos = stack.indexOf(this) - ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) - ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) - if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) - } - else stack.push(value) +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + __nccwpck_require__(98199), + __nccwpck_require__(20060), + __nccwpck_require__(16290), + __nccwpck_require__(91935), + __nccwpck_require__(9967), + __nccwpck_require__(36630), + __nccwpck_require__(57117), + __nccwpck_require__(44263), + __nccwpck_require__(14638), +]; - return replacer == null ? value : replacer.call(this, key, value) - } +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i]; + for (var enc in module) + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; } /***/ }), -/***/ 91393: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -let _fs -try { - _fs = __webpack_require__(82161) -} catch (_) { - _fs = __webpack_require__(35747) -} -const universalify = __webpack_require__(92178) -const { stringify, stripBom } = __webpack_require__(24401) - -async function _readFile (file, options = {}) { - if (typeof options === 'string') { - options = { encoding: options } - } +/***/ 98199: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const fs = options.fs || _fs +"use strict"; - const shouldThrow = 'throws' in options ? options.throws : true +var Buffer = __nccwpck_require__(52340).Buffer; - let data = await universalify.fromCallback(fs.readFile)(file, options) +// Export Node.js internal encodings. - data = stripBom(data) +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", - let obj - try { - obj = JSON.parse(data, options ? options.reviver : null) - } catch (err) { - if (shouldThrow) { - err.message = `${file}: ${err.message}` - throw err - } else { - return null - } - } + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", - return obj -} + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, -const readFile = universalify.fromPromise(_readFile) + // Codec. + _internal: InternalCodec, +}; -function readFileSync (file, options = {}) { - if (typeof options === 'string') { - options = { encoding: options } - } +//------------------------------------------------------------------------------ - const fs = options.fs || _fs +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; - const shouldThrow = 'throws' in options ? options.throws : true + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; - try { - let content = fs.readFileSync(file, options) - content = stripBom(content) - return JSON.parse(content, options.reviver) - } catch (err) { - if (shouldThrow) { - err.message = `${file}: ${err.message}` - throw err - } else { - return null + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } } - } } -async function _writeFile (file, obj, options = {}) { - const fs = options.fs || _fs - - const str = stringify(obj, options) +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; - await universalify.fromCallback(fs.writeFile)(file, str, options) -} +//------------------------------------------------------------------------------ -const writeFile = universalify.fromPromise(_writeFile) +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = __nccwpck_require__(24304).StringDecoder; -function writeFileSync (file, obj, options = {}) { - const fs = options.fs || _fs +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; - const str = stringify(obj, options) - // not sure if fs.writeFileSync returns anything, but just in case - return fs.writeFileSync(file, str, options) -} -const jsonfile = { - readFile, - readFileSync, - writeFile, - writeFileSync +function InternalDecoder(options, codec) { + this.decoder = new StringDecoder(codec.enc); } -module.exports = jsonfile - +InternalDecoder.prototype.write = function(buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf); + } -/***/ }), + return this.decoder.write(buf); +} -/***/ 24401: -/***/ ((module) => { +InternalDecoder.prototype.end = function() { + return this.decoder.end(); +} -function stringify (obj, options = {}) { - const EOL = options.EOL || '\n' - const str = JSON.stringify(obj, options ? options.replacer : null, options.spaces) +//------------------------------------------------------------------------------ +// Encoder is mostly trivial - return str.replace(/\n/g, EOL) + EOL +function InternalEncoder(options, codec) { + this.enc = codec.enc; } -function stripBom (content) { - // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified - if (Buffer.isBuffer(content)) content = content.toString('utf8') - return content.replace(/^\uFEFF/, '') +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); } -module.exports = { stringify, stripBom } - - -/***/ }), +InternalEncoder.prototype.end = function() { +} -/***/ 88735: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -"use strict"; +//------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; +} -const EventEmitter = __webpack_require__(28614); -const JSONB = __webpack_require__(75337); +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); -const loadStore = opts => { - const adapters = { - redis: '@keyv/redis', - mongodb: '@keyv/mongo', - mongo: '@keyv/mongo', - sqlite: '@keyv/sqlite', - postgresql: '@keyv/postgres', - postgres: '@keyv/postgres', - mysql: '@keyv/mysql' - }; - if (opts.adapter || opts.uri) { - const adapter = opts.adapter || /^[^:]*/.exec(opts.uri)[0]; - return new (require(adapters[adapter]))(opts); - } - return new Map(); -}; + return Buffer.from(str, "base64"); +} -class Keyv extends EventEmitter { - constructor(uri, opts) { - super(); - this.opts = Object.assign( - { - namespace: 'keyv', - serialize: JSONB.stringify, - deserialize: JSONB.parse - }, - (typeof uri === 'string') ? { uri } : uri, - opts - ); +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); +} - if (!this.opts.store) { - const adapterOpts = Object.assign({}, this.opts); - this.opts.store = loadStore(adapterOpts); - } - if (typeof this.opts.store.on === 'function') { - this.opts.store.on('error', err => this.emit('error', err)); - } +//------------------------------------------------------------------------------ +// CESU-8 encoder is also special. - this.opts.store.namespace = this.opts.namespace; - } +function InternalEncoderCesu8(options, codec) { +} - _getKeyPrefix(key) { - return `${this.opts.namespace}:${key}`; - } +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + } + return buf.slice(0, bufIdx); +} - get(key) { - key = this._getKeyPrefix(key); - const store = this.opts.store; - return Promise.resolve() - .then(() => store.get(key)) - .then(data => { - data = (typeof data === 'string') ? this.opts.deserialize(data) : data; - if (data === undefined) { - return undefined; - } - if (typeof data.expires === 'number' && Date.now() > data.expires) { - this.delete(key); - return undefined; - } - return data.value; - }); - } +InternalEncoderCesu8.prototype.end = function() { +} - set(key, value, ttl) { - key = this._getKeyPrefix(key); - if (typeof ttl === 'undefined') { - ttl = this.opts.ttl; - } - if (ttl === 0) { - ttl = undefined; - } - const store = this.opts.store; +//------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ - return Promise.resolve() - .then(() => { - const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; - value = { value, expires }; - return store.set(key, this.opts.serialize(value), ttl); - }) - .then(() => true); - } +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; +} - delete(key) { - key = this._getKeyPrefix(key); - const store = this.opts.store; - return Promise.resolve() - .then(() => store.delete(key)); - } +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } - clear() { - const store = this.opts.store; - return Promise.resolve() - .then(() => store.clear()); - } + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; } -module.exports = Keyv; +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; +} /***/ }), -/***/ 99036: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9967: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var LF = '\n'; -var CR = '\r'; -var LinesAndColumns = (function () { - function LinesAndColumns(string) { - this.string = string; - var offsets = [0]; - for (var offset = 0; offset < string.length;) { - switch (string[offset]) { - case LF: - offset += LF.length; - offsets.push(offset); - break; - case CR: - offset += CR.length; - if (string[offset] === LF) { - offset += LF.length; - } - offsets.push(offset); - break; - default: - offset++; - break; - } - } - this.offsets = offsets; - } - LinesAndColumns.prototype.locationForIndex = function (index) { - if (index < 0 || index > this.string.length) { - return null; - } - var line = 0; - var offsets = this.offsets; - while (offsets[line + 1] <= index) { - line++; - } - var column = index - offsets[line]; - return { line: line, column: column }; - }; - LinesAndColumns.prototype.indexForLocation = function (location) { - var line = location.line, column = location.column; - if (line < 0 || line >= this.offsets.length) { - return null; - } - if (column < 0 || column > this.lengthOfLine(line)) { - return null; - } - return this.offsets[line] + column; - }; - LinesAndColumns.prototype.lengthOfLine = function (line) { - var offset = this.offsets[line]; - var nextOffset = line === this.offsets.length - 1 ? this.string.length : this.offsets[line + 1]; - return nextOffset - offset; - }; - return LinesAndColumns; -}()); -exports.__esModule = true; -exports.default = LinesAndColumns; - +var Buffer = __nccwpck_require__(52340).Buffer; -/***/ }), +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). -/***/ 30815: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +exports._sbcs = SBCSCodec; +function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data.") + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) + throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i = 0; i < 128; i++) + asciiString += String.fromCharCode(i); + codecOptions.chars = asciiString + codecOptions.chars; + } -"use strict"; + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); -const path = __webpack_require__(85622); -const fs = __webpack_require__(35747); -const {promisify} = __webpack_require__(31669); -const pLocate = __webpack_require__(60364); + for (var i = 0; i < codecOptions.chars.length; i++) + encodeBuf[codecOptions.chars.charCodeAt(i)] = i; -const fsStat = promisify(fs.stat); -const fsLStat = promisify(fs.lstat); + this.encodeBuf = encodeBuf; +} -const typeMappings = { - directory: 'isDirectory', - file: 'isFile' -}; +SBCSCodec.prototype.encoder = SBCSEncoder; +SBCSCodec.prototype.decoder = SBCSDecoder; -function checkType({type}) { - if (type in typeMappings) { - return; - } - throw new Error(`Invalid type specified: ${type}`); +function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; } -const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); +SBCSEncoder.prototype.write = function(str) { + var buf = Buffer.alloc(str.length); + for (var i = 0; i < str.length; i++) + buf[i] = this.encodeBuf[str.charCodeAt(i)]; + + return buf; +} -module.exports = async (paths, options) => { - options = { - cwd: process.cwd(), - type: 'file', - allowSymlinks: true, - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fsStat : fsLStat; +SBCSEncoder.prototype.end = function() { +} - return pLocate(paths, async path_ => { - try { - const stat = await statFn(path.resolve(options.cwd, path_)); - return matchType(options.type, stat); - } catch (_) { - return false; - } - }, options); -}; -module.exports.sync = (paths, options) => { - options = { - cwd: process.cwd(), - allowSymlinks: true, - type: 'file', - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; +function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; +} - for (const path_ of paths) { - try { - const stat = statFn(path.resolve(options.cwd, path_)); +SBCSDecoder.prototype.write = function(buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf; + var newBuf = Buffer.alloc(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2+1] = decodeBuf[idx1+1]; + } + return newBuf.toString('ucs2'); +} - if (matchType(options.type, stat)) { - return path_; - } - } catch (_) { - } - } -}; +SBCSDecoder.prototype.end = function() { +} /***/ }), -/***/ 41066: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); +/***/ 57117: +/***/ ((module) => { -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'); +"use strict"; -module.exports = DataView; +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + } +} /***/ }), -/***/ 30731: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 36630: +/***/ ((module) => { -var hashClear = __webpack_require__(79130), - hashDelete = __webpack_require__(93067), - hashGet = __webpack_require__(21098), - hashHas = __webpack_require__(73949), - hashSet = __webpack_require__(48911); +"use strict"; -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +// Manually added data to be used by sbcs codec in addition to generated one. -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; +module.exports = { + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, -module.exports = Hash; + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, -/***/ }), + "cp720": { + "type": "_sbcs", + "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, -/***/ 82746: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", -var listCacheClear = __webpack_require__(52523), - listCacheDelete = __webpack_require__(19937), - listCacheGet = __webpack_require__(15131), - listCacheHas = __webpack_require__(89528), - listCacheSet = __webpack_require__(51635); + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek" : "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", -module.exports = ListCache; + "cp819": "iso88591", + "ibm819": "iso88591", + "cyrillic": "iso88595", -/***/ }), + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", -/***/ 51105: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + "greek" : "iso88597", + "greek8" : "iso88597", + "ecma118" : "iso88597", + "elot928" : "iso88597", -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); + "hebrew": "iso88598", + "hebrew8": "iso88598", -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'); + "turkish": "iso88599", + "turkish8": "iso88599", -module.exports = Map; + "thai": "iso885911", + "thai8": "iso885911", + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", -/***/ }), + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", -/***/ 16531: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", -var mapCacheClear = __webpack_require__(3489), - mapCacheDelete = __webpack_require__(288), - mapCacheGet = __webpack_require__(15712), - mapCacheHas = __webpack_require__(80369), - mapCacheSet = __webpack_require__(66935); + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", -module.exports = MapCache; + "strk10482002": "rk1048", + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", -/***/ }), + "gb198880": "iso646cn", + "cn": "iso646cn", -/***/ 40514: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", -/* Built-in method references that are verified to be native. */ -var Promise = getNative(root, 'Promise'); + "mac": "macintosh", + "csmacintosh": "macintosh", +}; -module.exports = Promise; /***/ }), -/***/ 9056: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); - -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); - -module.exports = Set; +/***/ 16290: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +"use strict"; -/***/ }), +var Buffer = __nccwpck_require__(52340).Buffer; -/***/ 49754: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js -var ListCache = __webpack_require__(82746), - stackClear = __webpack_require__(22614), - stackDelete = __webpack_require__(24202), - stackGet = __webpack_require__(96310), - stackHas = __webpack_require__(58721), - stackSet = __webpack_require__(90320); +// == UTF16-BE codec. ========================================================== -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; +exports.utf16be = Utf16BECodec; +function Utf16BECodec() { } -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; +Utf16BECodec.prototype.encoder = Utf16BEEncoder; +Utf16BECodec.prototype.decoder = Utf16BEDecoder; +Utf16BECodec.prototype.bomAware = true; -module.exports = Stack; +// -- Encoding -/***/ }), +function Utf16BEEncoder() { +} -/***/ 39929: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer.from(str, 'ucs2'); + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; + } + return buf; +} -var root = __webpack_require__(562); +Utf16BEEncoder.prototype.end = function() { +} -/** Built-in value references. */ -var Symbol = root.Symbol; -module.exports = Symbol; +// -- Decoding +function Utf16BEDecoder() { + this.overflowByte = -1; +} -/***/ }), +Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ''; -/***/ 81918: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var buf2 = Buffer.alloc(buf.length + 1), + i = 0, j = 0; -var root = __webpack_require__(562); + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i = 1; j = 2; + } -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; + for (; i < buf.length-1; i += 2, j+= 2) { + buf2[j] = buf[i+1]; + buf2[j+1] = buf[i]; + } -module.exports = Uint8Array; + this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; + return buf2.slice(0, j).toString('ucs2'); +} -/***/ }), +Utf16BEDecoder.prototype.end = function() { + this.overflowByte = -1; +} -/***/ 87243: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var getNative = __webpack_require__(76028), - root = __webpack_require__(562); +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); -/* Built-in method references that are verified to be native. */ -var WeakMap = getNative(root, 'WeakMap'); +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). -module.exports = WeakMap; +exports.utf16 = Utf16Codec; +function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; +} +Utf16Codec.prototype.encoder = Utf16Encoder; +Utf16Codec.prototype.decoder = Utf16Decoder; -/***/ }), -/***/ 99502: -/***/ ((module) => { +// -- Encoding (pass-through) -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); +function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === undefined) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder('utf-16le', options); } -module.exports = apply; +Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); +} +Utf16Encoder.prototype.end = function() { + return this.encoder.end(); +} -/***/ }), -/***/ 98029: -/***/ ((module) => { +// -- Decoding -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; +function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; + this.options = options || {}; + this.iconv = codec.iconv; } -module.exports = arrayEach; - - -/***/ }), +Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) + return ''; -/***/ 69459: -/***/ ((module) => { + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); -/** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } - } - return result; -} - -module.exports = arrayFilter; + return this.decoder.write(buf); +} -/***/ }), +Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); -/***/ 63360: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); -var baseTimes = __webpack_require__(15683), - isArguments = __webpack_require__(24839), - isArray = __webpack_require__(43364), - isBuffer = __webpack_require__(12963), - isIndex = __webpack_require__(72950), - isTypedArray = __webpack_require__(53635); + var trail = this.decoder.end(); + if (trail) + resStr += trail; -/** Used for built-in method references. */ -var objectProto = Object.prototype; + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + return this.decoder.end(); +} -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; + if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; + } - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } + } + } } - } - return result; + + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; + if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-16le'; } -module.exports = arrayLikeKeys; + /***/ }), -/***/ 77680: -/***/ ((module) => { +/***/ 20060: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); +"use strict"; - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} -module.exports = arrayMap; +var Buffer = __nccwpck_require__(52340).Buffer; +// == UTF32-LE/BE codec. ========================================================== -/***/ }), +exports._utf32 = Utf32Codec; -/***/ 52061: -/***/ ((module) => { +function Utf32Codec(codecOptions, iconv) { + this.iconv = iconv; + this.bomAware = true; + this.isLE = codecOptions.isLE; +} -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; +exports.utf32le = { type: '_utf32', isLE: true }; +exports.utf32be = { type: '_utf32', isLE: false }; - while (++index < length) { - array[offset + index] = values[index]; - } - return array; +// Aliases +exports.ucs4le = 'utf32le'; +exports.ucs4be = 'utf32be'; + +Utf32Codec.prototype.encoder = Utf32Encoder; +Utf32Codec.prototype.decoder = Utf32Decoder; + +// -- Encoding + +function Utf32Encoder(options, codec) { + this.isLE = codec.isLE; + this.highSurrogate = 0; } -module.exports = arrayPush; +Utf32Encoder.prototype.write = function(str) { + var src = Buffer.from(str, 'ucs2'); + var dst = Buffer.alloc(src.length * 2); + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; + var offset = 0; + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i); + var isHighSurrogate = (0xD800 <= code && code < 0xDC00); + var isLowSurrogate = (0xDC00 <= code && code < 0xE000); -/***/ }), + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset); + offset += 4; + } + else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; -/***/ 55647: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + write32.call(dst, codepoint, offset); + offset += 4; + this.highSurrogate = 0; -var baseAssignValue = __webpack_require__(71850), - eq = __webpack_require__(28650); + continue; + } + } -/** Used for built-in method references. */ -var objectProto = Object.prototype; + if (isHighSurrogate) + this.highSurrogate = code; + else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset); + offset += 4; + this.highSurrogate = 0; + } + } -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + if (offset < dst.length) + dst = dst.slice(0, offset); -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } + return dst; +}; + +Utf32Encoder.prototype.end = function() { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) + return; + + var buf = Buffer.alloc(4); + + if (this.isLE) + buf.writeUInt32LE(this.highSurrogate, 0); + else + buf.writeUInt32BE(this.highSurrogate, 0); + + this.highSurrogate = 0; + + return buf; +}; + +// -- Decoding + +function Utf32Decoder(options, codec) { + this.isLE = codec.isLE; + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); + this.overflow = []; } -module.exports = assignValue; +Utf32Decoder.prototype.write = function(src) { + if (src.length === 0) + return ''; + var i = 0; + var codepoint = 0; + var dst = Buffer.alloc(src.length + 4); + var offset = 0; + var isLE = this.isLE; + var overflow = this.overflow; + var badChar = this.badChar; -/***/ }), + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) + overflow.push(src[i]); + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); + } else { + codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); + } + overflow.length = 0; -/***/ 886: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + } -var eq = __webpack_require__(28650); + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); + } else { + codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); + } + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]); } - } - return -1; -} -module.exports = assocIndexOf; + return dst.slice(0, offset).toString('ucs2'); +}; +function _writeCodepoint(dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar; + } -/***/ }), + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000; -/***/ 57361: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var high = 0xD800 | (codepoint >> 10); + dst[offset++] = high & 0xff; + dst[offset++] = high >> 8; -var copyObject = __webpack_require__(83568), - keys = __webpack_require__(50288); + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF); + } -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff; + dst[offset++] = codepoint >> 8; -module.exports = baseAssign; + return offset; +}; +Utf32Decoder.prototype.end = function() { + this.overflow.length = 0; +}; -/***/ }), +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); -/***/ 86677: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// Encoder prepends BOM (which can be overridden with (addBOM: false}). -var copyObject = __webpack_require__(83568), - keysIn = __webpack_require__(86032); +exports.utf32 = Utf32AutoCodec; +exports.ucs4 = 'utf32'; -/** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); +function Utf32AutoCodec(options, iconv) { + this.iconv = iconv; } -module.exports = baseAssignIn; +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; +// -- Encoding -/***/ }), +function Utf32AutoEncoder(options, codec) { + options = options || {}; -/***/ 71850: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (options.addBOM === undefined) + options.addBOM = true; -var defineProperty = __webpack_require__(59252); + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); +} -/** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } +Utf32AutoEncoder.prototype.write = function(str) { + return this.encoder.write(str); +}; + +Utf32AutoEncoder.prototype.end = function() { + return this.encoder.end(); +}; + +// -- Decoding + +function Utf32AutoDecoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; + this.options = options || {}; + this.iconv = codec.iconv; } -module.exports = baseAssignValue; +Utf32AutoDecoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + return ''; -/***/ }), + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); -/***/ 95570: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Stack = __webpack_require__(49754), - arrayEach = __webpack_require__(98029), - assignValue = __webpack_require__(55647), - baseAssign = __webpack_require__(57361), - baseAssignIn = __webpack_require__(86677), - cloneBuffer = __webpack_require__(82009), - copyArray = __webpack_require__(76640), - copySymbols = __webpack_require__(85337), - copySymbolsIn = __webpack_require__(93017), - getAllKeys = __webpack_require__(18785), - getAllKeysIn = __webpack_require__(54296), - getTag = __webpack_require__(207), - initCloneArray = __webpack_require__(4025), - initCloneByTag = __webpack_require__(27353), - initCloneObject = __webpack_require__(66312), - isArray = __webpack_require__(43364), - isBuffer = __webpack_require__(12963), - isMap = __webpack_require__(13689), - isObject = __webpack_require__(43420), - isSet = __webpack_require__(81360), - keys = __webpack_require__(50288); + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; + return this.decoder.write(buf); +}; -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +Utf32AutoDecoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; + var trail = this.decoder.end(); + if (trail) + resStr += trail; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); + return this.decoder.end(); +}; - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. + + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return 'utf-32le'; + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return 'utf-32be'; + } + } - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); + if (b[0] !== 0 || b[1] > 0x10) invalidBE++; + if (b[3] !== 0 || b[2] > 0x10) invalidLE++; - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } + } + } } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; -} -module.exports = baseClone; + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-32le'; +} /***/ }), -/***/ 14794: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 91935: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var isObject = __webpack_require__(43420); +"use strict"; -/** Built-in value references. */ -var objectCreate = Object.create; +var Buffer = __nccwpck_require__(52340).Buffer; -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 -module.exports = baseCreate; +exports.utf7 = Utf7Codec; +exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 +function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; +}; +Utf7Codec.prototype.encoder = Utf7Encoder; +Utf7Codec.prototype.decoder = Utf7Decoder; +Utf7Codec.prototype.bomAware = true; -/***/ }), -/***/ 5765: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// -- Encoding -var arrayPush = __webpack_require__(52061), - isFlattenable = __webpack_require__(6426); +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; +function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; +} - predicate || (predicate = isFlattenable); - result || (result = []); +Utf7Encoder.prototype.write = function(str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + + "-"; + }.bind(this))); +} - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; +Utf7Encoder.prototype.end = function() { } -module.exports = baseFlatten; +// -- Decoding -/***/ }), +function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} -/***/ 86685: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var base64Regex = /[A-Za-z0-9\/+]/; +var base64Chars = []; +for (var i = 0; i < 256; i++) + base64Chars[i] = base64Regex.test(String.fromCharCode(i)); -var castPath = __webpack_require__(18963), - toKey = __webpack_require__(30668); +var plusChar = '+'.charCodeAt(0), + minusChar = '-'.charCodeAt(0), + andChar = '&'.charCodeAt(0); -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = castPath(path, object); +Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; - var index = 0, - length = path.length; + // The decoder is more involved as we must handle chunks in stream. - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" + res += "+"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } -module.exports = baseGet; + if (buf[i] != minusChar) // Minus is absorbed after base64. + i--; + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } -/***/ }), + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); -/***/ 98160: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); -var arrayPush = __webpack_require__(52061), - isArray = __webpack_require__(43364); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; } -module.exports = baseGetAllKeys; +Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + this.inBase64 = false; + this.base64Accum = ''; + return res; +} -/***/ }), -/***/ 98653: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. -var Symbol = __webpack_require__(39929), - getRawTag = __webpack_require__(32608), - objectToString = __webpack_require__(49052); -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; +exports.utf7imap = Utf7IMAPCodec; +function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; +}; -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; +Utf7IMAPCodec.prototype.bomAware = true; -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); + +// -- Encoding + +function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer.alloc(6); + this.base64AccumIdx = 0; } -module.exports = baseGetTag; +Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, + base64Accum = this.base64Accum, + base64AccumIdx = this.base64AccumIdx, + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i); + if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + base64AccumIdx = 0; + } -/***/ }), + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + inBase64 = false; + } -/***/ 56263: -/***/ ((module) => { + if (!inBase64) { + buf[bufIdx++] = uChar; // Write direct character -/** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHasIn(object, key) { - return object != null && key in Object(object); -} + if (uChar === andChar) // Ampersand -> '&-' + buf[bufIdx++] = minusChar; + } -module.exports = baseHasIn; + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 0xFF; + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); + base64AccumIdx = 0; + } + } + } + } -/***/ }), + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; -/***/ 77907: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return buf.slice(0, bufIdx); +} -var baseGetTag = __webpack_require__(98653), - isObjectLike = __webpack_require__(9111); +Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + this.base64AccumIdx = 0; + } -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + this.inBase64 = false; + } -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; + return buf.slice(0, bufIdx); } -module.exports = baseIsArguments; +// -- Decoding -/***/ }), +function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} -/***/ 81391: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var base64IMAPChars = base64Chars.slice(); +base64IMAPChars[','.charCodeAt(0)] = true; -var getTag = __webpack_require__(207), - isObjectLike = __webpack_require__(9111); +Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; -/** `Object#toString` result references. */ -var mapTag = '[object Map]'; + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). -/** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ -function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; } -module.exports = baseIsMap; + /***/ }), -/***/ 72294: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 44162: +/***/ ((__unused_webpack_module, exports) => { -var isFunction = __webpack_require__(66827), - isMasked = __webpack_require__(16716), - isObject = __webpack_require__(43420), - toSource = __webpack_require__(98241); +"use strict"; -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; +var BOMChar = '\uFEFF'; -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; +} -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + return this.encoder.write(str); +} -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); +PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); +} -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); + +//------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper; +function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; +} + +StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; + + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === 'function') + this.options.stripBOM(); + } + + this.pass = true; + return res; +} + +StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); } -module.exports = baseIsNative; /***/ }), -/***/ 19472: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var getTag = __webpack_require__(207), - isObjectLike = __webpack_require__(9111); - -/** `Object#toString` result references. */ -var setTag = '[object Set]'; - -/** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ -function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; -} +/***/ 21377: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = baseIsSet; +"use strict"; -/***/ }), +var Buffer = __nccwpck_require__(52340).Buffer; -/***/ 86944: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var bomHandling = __nccwpck_require__(44162), + iconv = module.exports; -var baseGetTag = __webpack_require__(98653), - isLength = __webpack_require__(55752), - isObjectLike = __webpack_require__(9111); +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +iconv.encodings = null; -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; +// Characters emitted in case of error. +iconv.defaultCharUnicode = '�'; +iconv.defaultCharSingleByte = '?'; -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +// Public API. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; + var encoder = iconv.getEncoder(encoding, options); -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; } -module.exports = baseIsTypedArray; - - -/***/ }), +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } -/***/ 24787: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. + } -var isPrototype = __webpack_require__(4954), - nativeKeys = __webpack_require__(11491); + var decoder = iconv.getDecoder(encoding, options); -/** Used for built-in method references. */ -var objectProto = Object.prototype; + var res = decoder.write(buf); + var trail = decoder.end(); -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + return trail ? (res + trail) : res; +} -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { + return false; } - } - return result; } -module.exports = baseKeys; +// Legacy aliases to convert functions +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = __nccwpck_require__(62228); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); -/***/ }), + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; -/***/ 14535: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var codecDef = iconv.encodings[enc]; -var isObject = __webpack_require__(43420), - isPrototype = __webpack_require__(4954), - nativeKeysIn = __webpack_require__(43101); + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; -/** Used for built-in method references. */ -var objectProto = Object.prototype; + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; -/** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); -module.exports = baseKeysIn; + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + } +} -/***/ }), +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} -/***/ 3529: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); -var basePickBy = __webpack_require__(85041), - hasIn = __webpack_require__(14426); + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); -/** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ -function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); + return encoder; } -module.exports = basePick; - +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); -/***/ }), + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); -/***/ 85041: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + return decoder; +} -var baseGet = __webpack_require__(86685), - baseSet = __webpack_require__(90374), - castPath = __webpack_require__(18963); +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { + if (iconv.supportsStreams) + return; -/** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ -function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; + // Dependency-inject stream module to create IconvLite stream classes. + var streams = __nccwpck_require__(2409)(stream_module); - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); + // Not public API yet, but expose the stream classes. + iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); + // Streaming API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); } - } - return result; -} - -module.exports = basePickBy; + iconv.decodeStream = function decodeStream(encoding, options) { + return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + } -/***/ }), + iconv.supportsStreams = true; +} -/***/ 31428: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var stream_module; +try { + stream_module = __nccwpck_require__(92413); +} catch (e) {} -var identity = __webpack_require__(57460), - overRest = __webpack_require__(216), - setToString = __webpack_require__(65444); +if (stream_module && stream_module.Transform) { + iconv.enableStreamingAPI(stream_module); -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + iconv.encodeStream = iconv.decodeStream = function() { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); + }; } -module.exports = baseRest; +if (false) {} /***/ }), -/***/ 90374: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 2409: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var assignValue = __webpack_require__(55647), - castPath = __webpack_require__(18963), - isIndex = __webpack_require__(72950), - isObject = __webpack_require__(43420), - toKey = __webpack_require__(30668); +"use strict"; -/** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ -function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = castPath(path, object); - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; +var Buffer = __nccwpck_require__(52340).Buffer; - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function(stream_module) { + var Transform = stream_module.Transform; - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; -} + // == Encoder stream ======================================================= -module.exports = baseSet; + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); + } + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); -/***/ }), + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } -/***/ 3503: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } -var constant = __webpack_require__(66915), - defineProperty = __webpack_require__(59252), - identity = __webpack_require__(57460); + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; + } -/** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; -module.exports = baseSetToString; + // == Decoder stream ======================================================= + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); + } -/***/ }), + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }); -/***/ 15683: -/***/ ((module) => { + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; + } -module.exports = baseTimes; + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream, + }; +}; /***/ }), -/***/ 74851: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Symbol = __webpack_require__(39929), - arrayMap = __webpack_require__(77680), - isArray = __webpack_require__(43364), - isSymbol = __webpack_require__(82500); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; +/***/ 2989: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +try { + var util = __nccwpck_require__(31669); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = __nccwpck_require__(97350); } -module.exports = baseToString; - /***/ }), -/***/ 83717: +/***/ 97350: /***/ ((module) => { -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } } -module.exports = baseUnary; - /***/ }), -/***/ 18963: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 27452: +/***/ ((__unused_webpack_module, exports) => { -var isArray = __webpack_require__(43364), - isKey = __webpack_require__(20007), - stringToPath = __webpack_require__(35725), - toString = __webpack_require__(49228); +exports.parse = exports.decode = decode -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value, object) { - if (isArray(value)) { - return value; +exports.stringify = exports.encode = encode + +exports.safe = safe +exports.unsafe = unsafe + +var eol = typeof process !== 'undefined' && + process.platform === 'win32' ? '\r\n' : '\n' + +function encode (obj, opt) { + var children = [] + var out = '' + + if (typeof opt === 'string') { + opt = { + section: opt, + whitespace: false, + } + } else { + opt = opt || {} + opt.whitespace = opt.whitespace === true } - return isKey(value, object) ? [value] : stringToPath(toString(value)); -} -module.exports = castPath; + var separator = opt.whitespace ? ' = ' : '=' + Object.keys(obj).forEach(function (k, _, __) { + var val = obj[k] + if (val && Array.isArray(val)) { + val.forEach(function (item) { + out += safe(k + '[]') + separator + safe(item) + '\n' + }) + } else if (val && typeof val === 'object') + children.push(k) + else + out += safe(k) + separator + safe(val) + eol + }) -/***/ }), + if (opt.section && out.length) + out = '[' + safe(opt.section) + ']' + eol + out -/***/ 18384: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + children.forEach(function (k, _, __) { + var nk = dotSplit(k).join('\\.') + var section = (opt.section ? opt.section + '.' : '') + nk + var child = encode(obj[k], { + section: section, + whitespace: opt.whitespace, + }) + if (out.length && child.length) + out += eol -var Uint8Array = __webpack_require__(81918); + out += child + }) -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; + return out } -module.exports = cloneArrayBuffer; +function dotSplit (str) { + return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') + .replace(/\\\./g, '\u0001') + .split(/\./).map(function (part) { + return part.replace(/\1/g, '\\.') + .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') + }) +} +function decode (str) { + var out = {} + var p = out + var section = null + // section |key = value + var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i + var lines = str.split(/[\r\n]+/g) -/***/ }), + lines.forEach(function (line, _, __) { + if (!line || line.match(/^\s*[;#]/)) + return + var match = line.match(re) + if (!match) + return + if (match[1] !== undefined) { + section = unsafe(match[1]) + if (section === '__proto__') { + // not allowed + // keep parsing the section, but don't attach it. + p = {} + return + } + p = out[section] = out[section] || {} + return + } + var key = unsafe(match[2]) + if (key === '__proto__') + return + var value = match[3] ? unsafe(match[4]) : true + switch (value) { + case 'true': + case 'false': + case 'null': value = JSON.parse(value) + } -/***/ 82009: -/***/ ((module, exports, __webpack_require__) => { + // Convert keys with '[]' suffix to an array + if (key.length > 2 && key.slice(-2) === '[]') { + key = key.substring(0, key.length - 2) + if (key === '__proto__') + return + if (!p[key]) + p[key] = [] + else if (!Array.isArray(p[key])) + p[key] = [p[key]] + } -/* module decorator */ module = __webpack_require__.nmd(module); -var root = __webpack_require__(562); + // safeguard against resetting a previously defined + // array by accidentally forgetting the brackets + if (Array.isArray(p[key])) + p[key].push(value) + else + p[key] = value + }) -/** Detect free variable `exports`. */ -var freeExports = true && exports && !exports.nodeType && exports; + // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} + // use a filter to return the keys that have to be deleted. + Object.keys(out).filter(function (k, _, __) { + if (!out[k] || + typeof out[k] !== 'object' || + Array.isArray(out[k])) + return false -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + // see if the parent section is also an object. + // if so, add it to that, and mark this one for deletion + var parts = dotSplit(k) + var p = out + var l = parts.pop() + var nl = l.replace(/\\\./g, '.') + parts.forEach(function (part, _, __) { + if (part === '__proto__') + return + if (!p[part] || typeof p[part] !== 'object') + p[part] = {} + p = p[part] + }) + if (p === out && nl === l) + return false -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; + p[nl] = out[k] + return true + }).forEach(function (del, _, __) { + delete out[del] + }) -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + return out +} -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); +function isQuoted (val) { + return (val.charAt(0) === '"' && val.slice(-1) === '"') || + (val.charAt(0) === "'" && val.slice(-1) === "'") +} - buffer.copy(result); - return result; +function safe (val) { + return (typeof val !== 'string' || + val.match(/[=\r\n]/) || + val.match(/^\[/) || + (val.length > 1 && + isQuoted(val)) || + val !== val.trim()) + ? JSON.stringify(val) + : val.replace(/;/g, '\\;').replace(/#/g, '\\#') } -module.exports = cloneBuffer; +function unsafe (val, doUnesc) { + val = (val || '').trim() + if (isQuoted(val)) { + // remove the single quotes before calling JSON.parse + if (val.charAt(0) === "'") + val = val.substr(1, val.length - 2) + + try { + val = JSON.parse(val) + } catch (_) {} + } else { + // walk the val to find the first not-escaped ; character + var esc = false + var unesc = '' + for (var i = 0, l = val.length; i < l; i++) { + var c = val.charAt(i) + if (esc) { + if ('\\;#'.indexOf(c) !== -1) + unesc += c + else + unesc += '\\' + c + + esc = false + } else if (';#'.indexOf(c) !== -1) + break + else if (c === '\\') + esc = true + else + unesc += c + } + if (esc) + unesc += '\\' + + return unesc.trim() + } + return val +} /***/ }), -/***/ 8534: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 30237: +/***/ ((module) => { -var cloneArrayBuffer = __webpack_require__(18384); +"use strict"; -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} -module.exports = cloneDataView; +module.exports = function isArrayish(obj) { + if (!obj) { + return false; + } + + return obj instanceof Array || Array.isArray(obj) || + (obj.length >= 0 && obj.splice instanceof Function); +}; /***/ }), -/***/ 86549: -/***/ ((module) => { +/***/ 21176: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; +"use strict"; -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} -module.exports = cloneRegExp; +var has = __nccwpck_require__(97841); +function specifierIncluded(current, specifier) { + var nodeParts = current.split('.'); + var parts = specifier.split(' '); + var op = parts.length > 1 ? parts[0] : '='; + var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); -/***/ }), + for (var i = 0; i < 3; ++i) { + var cur = parseInt(nodeParts[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); + if (cur === ver) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + if (op === '<') { + return cur < ver; + } + if (op === '>=') { + return cur >= ver; + } + return false; + } + return op === '>='; +} -/***/ 81731: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function matchesRange(current, range) { + var specifiers = range.split(/ ?&& ?/); + if (specifiers.length === 0) { + return false; + } + for (var i = 0; i < specifiers.length; ++i) { + if (!specifierIncluded(current, specifiers[i])) { + return false; + } + } + return true; +} -var Symbol = __webpack_require__(39929); +function versionIncluded(nodeVersion, specifierValue) { + if (typeof specifierValue === 'boolean') { + return specifierValue; + } -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + var current = typeof nodeVersion === 'undefined' + ? process.versions && process.versions.node && process.versions.node + : nodeVersion; -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + if (typeof current !== 'string') { + throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required'); + } + + if (specifierValue && typeof specifierValue === 'object') { + for (var i = 0; i < specifierValue.length; ++i) { + if (matchesRange(current, specifierValue[i])) { + return true; + } + } + return false; + } + return matchesRange(current, specifierValue); } -module.exports = cloneSymbol; +var data = __nccwpck_require__(74986); + +module.exports = function isCore(x, nodeVersion) { + return has(data, x) && versionIncluded(nodeVersion, data[x]); +}; /***/ }), -/***/ 13817: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 47133: +/***/ ((module) => { -var cloneArrayBuffer = __webpack_require__(18384); +"use strict"; -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} -module.exports = cloneTypedArray; +module.exports = ({stream = process.stdout} = {}) => { + return Boolean( + stream && stream.isTTY && + process.env.TERM !== 'dumb' && + !('CI' in process.env) + ); +}; /***/ }), -/***/ 76640: +/***/ 93458: /***/ ((module) => { -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; +"use strict"; - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} -module.exports = copyArray; +const isStream = stream => + stream !== null && + typeof stream === 'object' && + typeof stream.pipe === 'function'; + +isStream.writable = stream => + isStream(stream) && + stream.writable !== false && + typeof stream._write === 'function' && + typeof stream._writableState === 'object'; + +isStream.readable = stream => + isStream(stream) && + stream.readable !== false && + typeof stream._read === 'function' && + typeof stream._readableState === 'object'; + +isStream.duplex = stream => + isStream.writable(stream) && + isStream.readable(stream); + +isStream.transform = stream => + isStream.duplex(stream) && + typeof stream._transform === 'function' && + typeof stream._transformState === 'object'; + +module.exports = isStream; /***/ }), -/***/ 83568: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 52607: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var assignValue = __webpack_require__(55647), - baseAssignValue = __webpack_require__(71850); +var fs = __nccwpck_require__(35747) +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = __nccwpck_require__(59750) +} else { + core = __nccwpck_require__(37821) +} -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); +module.exports = isexe +isexe.sync = sync - var index = -1, - length = props.length; +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } - while (++index < length) { - var key = props[index]; + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } - if (newValue === undefined) { - newValue = source[key]; + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false + } } - if (isNew) { - baseAssignValue(object, key, newValue); + cb(er, is) + }) +} + +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false } else { - assignValue(object, key, newValue); + throw er } } - return object; } -module.exports = copyObject; - /***/ }), -/***/ 85337: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 37821: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var copyObject = __webpack_require__(83568), - getSymbols = __webpack_require__(5841); +module.exports = isexe +isexe.sync = sync -/** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); +var fs = __nccwpck_require__(35747) + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, options)) + }) } -module.exports = copySymbols; +function sync (path, options) { + return checkStat(fs.statSync(path), options) +} +function checkStat (stat, options) { + return stat.isFile() && checkMode(stat, options) +} -/***/ }), +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid -/***/ 93017: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() -var copyObject = __webpack_require__(83568), - getSymbolsIn = __webpack_require__(85468); + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g -/** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); -} + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 -module.exports = copySymbolsIn; + return ret +} /***/ }), -/***/ 54554: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 59750: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = isexe +isexe.sync = sync -var root = __webpack_require__(562); +var fs = __nccwpck_require__(35747) -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT -module.exports = coreJsData; + if (!pathext) { + return true + } + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } + } + return false +} + +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) +} /***/ }), -/***/ 21479: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 52388: +/***/ ((__unused_webpack_module, exports) => { -var baseRest = __webpack_require__(31428), - isIterateeCall = __webpack_require__(78155); +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell +// License: MIT. (See LICENSE.) -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; +Object.defineProperty(exports, "__esModule", ({ + value: true +})) - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0], closed: undefined} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token } -module.exports = createAssigner; - /***/ }), -/***/ 59252: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 75337: +/***/ ((__unused_webpack_module, exports) => { -var getNative = __webpack_require__(76028); +//TODO: handle reviver/dehydrate function like normal +//and handle indentation, like normal. +//if anyone needs this... please send pull request. -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); +exports.stringify = function stringify (o) { + if('undefined' == typeof o) return o -module.exports = defineProperty; + if(o && Buffer.isBuffer(o)) + return JSON.stringify(':base64:' + o.toString('base64')) + if(o && o.toJSON) + o = o.toJSON() -/***/ }), + if(o && 'object' === typeof o) { + var s = '' + var array = Array.isArray(o) + s = array ? '[' : '{' + var first = true -/***/ 34800: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + for(var k in o) { + var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k]) + if(Object.hasOwnProperty.call(o, k) && !ignore) { + if(!first) + s += ',' + first = false + if (array) { + if(o[k] == undefined) + s += 'null' + else + s += stringify(o[k]) + } else if (o[k] !== void(0)) { + s += stringify(k) + ':' + stringify(o[k]) + } + } + } -var flatten = __webpack_require__(8708), - overRest = __webpack_require__(216), - setToString = __webpack_require__(65444); + s += array ? ']' : '}' -/** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ -function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); + return s + } else if ('string' === typeof o) { + return JSON.stringify(/^:/.test(o) ? ':' + o : o) + } else if ('undefined' === typeof o) { + return 'null'; + } else + return JSON.stringify(o) } -module.exports = flatRest; +exports.parse = function (s) { + return JSON.parse(s, function (key, value) { + if('string' === typeof value) { + if(/^:base64:/.test(value)) + return new Buffer(value.substring(8), 'base64') + else + return /^:/.test(value) ? value.substring(1) : value + } + return value + }) +} /***/ }), -/***/ 37825: +/***/ 36873: /***/ ((module) => { -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -module.exports = freeGlobal; - +"use strict"; -/***/ }), -/***/ 18785: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +const hexify = char => { + const h = char.charCodeAt(0).toString(16).toUpperCase() + return '0x' + (h.length % 2 ? '0' : '') + h +} -var baseGetAllKeys = __webpack_require__(98160), - getSymbols = __webpack_require__(5841), - keys = __webpack_require__(50288); +const parseError = (e, txt, context) => { + if (!txt) { + return { + message: e.message + ' while parsing empty string', + position: 0, + } + } + const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i) + const errIdx = badToken ? +badToken[2] + : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 + : null -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} + const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${ + JSON.stringify(badToken[1]) + } (${hexify(badToken[1])})`) + : e.message -module.exports = getAllKeys; + if (errIdx !== null && errIdx !== undefined) { + const start = errIdx <= context ? 0 + : errIdx - context + const end = errIdx + context >= txt.length ? txt.length + : errIdx + context -/***/ }), + const slice = (start === 0 ? '' : '...') + + txt.slice(start, end) + + (end === txt.length ? '' : '...') -/***/ 54296: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + const near = txt === slice ? '' : 'near ' -var baseGetAllKeys = __webpack_require__(98160), - getSymbolsIn = __webpack_require__(85468), - keysIn = __webpack_require__(86032); + return { + message: msg + ` while parsing ${near}${JSON.stringify(slice)}`, + position: errIdx, + } + } else { + return { + message: msg + ` while parsing '${txt.slice(0, context * 2)}'`, + position: 0, + } + } +} -/** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); +class JSONParseError extends SyntaxError { + constructor (er, txt, context, caller) { + context = context || 20 + const metadata = parseError(er, txt, context) + super(metadata.message) + Object.assign(this, metadata) + this.code = 'EJSONPARSE' + this.systemError = er + Error.captureStackTrace(this, caller || this.constructor) + } + get name () { return this.constructor.name } + set name (n) {} + get [Symbol.toStringTag] () { return this.constructor.name } } -module.exports = getAllKeysIn; +const kIndent = Symbol.for('indent') +const kNewline = Symbol.for('newline') +// only respect indentation if we got a line break, otherwise squash it +// things other than objects and arrays aren't indented, so ignore those +// Important: in both of these regexps, the $1 capture group is the newline +// or undefined, and the $2 capture group is the indent, or undefined. +const formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/ +const emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/ +const parseJson = (txt, reviver, context) => { + const parseText = stripBOM(txt) + context = context || 20 + try { + // get the indentation so that we can save it back nicely + // if the file starts with {" then we have an indent of '', ie, none + // otherwise, pick the indentation of the next line after the first \n + // If the pattern doesn't match, then it means no indentation. + // JSON.stringify ignores symbols, so this is reasonably safe. + // if the string is '{}' or '[]', then use the default 2-space indent. + const [, newline = '\n', indent = ' '] = parseText.match(emptyRE) || + parseText.match(formatRE) || + [, '', ''] + + const result = JSON.parse(parseText, reviver) + if (result && typeof result === 'object') { + result[kNewline] = newline + result[kIndent] = indent + } + return result + } catch (e) { + if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) { + const isEmptyArray = Array.isArray(txt) && txt.length === 0 + throw Object.assign(new TypeError( + `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}` + ), { + code: 'EJSONPARSE', + systemError: e, + }) + } -/***/ }), + throw new JSONParseError(e, parseText, context, parseJson) + } +} -/***/ 71198: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) +// because the buffer-to-string conversion in `fs.readFileSync()` +// translates it to FEFF, the UTF-16 BOM. +const stripBOM = txt => String(txt).replace(/^\uFEFF/, '') -var isKeyable = __webpack_require__(89958); +module.exports = parseJson +parseJson.JSONParseError = JSONParseError -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; +parseJson.noExceptions = (txt, reviver) => { + try { + return JSON.parse(stripBOM(txt), reviver) + } catch (e) {} } -module.exports = getMapData; - /***/ }), -/***/ 76028: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 4211: +/***/ ((module, exports) => { -var baseIsNative = __webpack_require__(72294), - getValue = __webpack_require__(64413); +exports = module.exports = stringify +exports.getSerialize = serializer -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; +function stringify(obj, replacer, spaces, cycleReplacer) { + return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) } -module.exports = getNative; - - -/***/ }), - -/***/ 63363: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function serializer(replacer, cycleReplacer) { + var stack = [], keys = [] -var overArg = __webpack_require__(90570); + if (cycleReplacer == null) cycleReplacer = function(key, value) { + if (stack[0] === value) return "[Circular ~]" + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" + } -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); + return function(key, value) { + if (stack.length > 0) { + var thisPos = stack.indexOf(this) + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) + if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) + } + else stack.push(value) -module.exports = getPrototype; + return replacer == null ? value : replacer.call(this, key, value) + } +} /***/ }), -/***/ 32608: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 91393: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Symbol = __webpack_require__(39929); +let _fs +try { + _fs = __nccwpck_require__(82161) +} catch (_) { + _fs = __nccwpck_require__(35747) +} +const universalify = __nccwpck_require__(92178) +const { stringify, stripBom } = __nccwpck_require__(24401) -/** Used for built-in method references. */ -var objectProto = Object.prototype; +async function _readFile (file, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + const fs = options.fs || _fs -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; + const shouldThrow = 'throws' in options ? options.throws : true -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + let data = await universalify.fromCallback(fs.readFile)(file, options) -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; + data = stripBom(data) + let obj try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}` + throw err } else { - delete value[symToStringTag]; + return null } } - return result; -} - -module.exports = getRawTag; - - -/***/ }), - -/***/ 5841: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var arrayFilter = __webpack_require__(69459), - stubArray = __webpack_require__(87632); -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; + return obj +} -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; +const readFile = universalify.fromPromise(_readFile) -/** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; +function readFileSync (file, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); -}; -module.exports = getSymbols; - - -/***/ }), - -/***/ 85468: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var arrayPush = __webpack_require__(52061), - getPrototype = __webpack_require__(63363), - getSymbols = __webpack_require__(5841), - stubArray = __webpack_require__(87632); + const fs = options.fs || _fs -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; + const shouldThrow = 'throws' in options ? options.throws : true -/** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); + try { + let content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}` + throw err + } else { + return null + } } - return result; -}; - -module.exports = getSymbolsIn; - - -/***/ }), - -/***/ 207: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +} -var DataView = __webpack_require__(41066), - Map = __webpack_require__(51105), - Promise = __webpack_require__(40514), - Set = __webpack_require__(9056), - WeakMap = __webpack_require__(87243), - baseGetTag = __webpack_require__(98653), - toSource = __webpack_require__(98241); +async function _writeFile (file, obj, options = {}) { + const fs = options.fs || _fs -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; + const str = stringify(obj, options) -var dataViewTag = '[object DataView]'; + await universalify.fromCallback(fs.writeFile)(file, str, options) +} -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); +const writeFile = universalify.fromPromise(_writeFile) -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; +function writeFileSync (file, obj, options = {}) { + const fs = options.fs || _fs -// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; + const str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) +} - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; +const jsonfile = { + readFile, + readFileSync, + writeFile, + writeFileSync } -module.exports = getTag; +module.exports = jsonfile /***/ }), -/***/ 64413: +/***/ 24401: /***/ ((module) => { -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; +function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) { + const EOF = finalEOL ? EOL : '' + const str = JSON.stringify(obj, replacer, spaces) + + return str.replace(/\n/g, EOL) + EOF } -module.exports = getValue; +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + return content.replace(/^\uFEFF/, '') +} + +module.exports = { stringify, stripBom } /***/ }), -/***/ 23144: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 88735: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var castPath = __webpack_require__(18963), - isArguments = __webpack_require__(24839), - isArray = __webpack_require__(43364), - isIndex = __webpack_require__(72950), - isLength = __webpack_require__(55752), - toKey = __webpack_require__(30668); +"use strict"; -/** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ -function hasPath(object, path, hasFunc) { - path = castPath(path, object); - var index = -1, - length = path.length, - result = false; +const EventEmitter = __nccwpck_require__(28614); +const JSONB = __nccwpck_require__(75337); - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); -} +const loadStore = opts => { + const adapters = { + redis: '@keyv/redis', + mongodb: '@keyv/mongo', + mongo: '@keyv/mongo', + sqlite: '@keyv/sqlite', + postgresql: '@keyv/postgres', + postgres: '@keyv/postgres', + mysql: '@keyv/mysql' + }; + if (opts.adapter || opts.uri) { + const adapter = opts.adapter || /^[^:]*/.exec(opts.uri)[0]; + return new (require(adapters[adapter]))(opts); + } + return new Map(); +}; -module.exports = hasPath; +class Keyv extends EventEmitter { + constructor(uri, opts) { + super(); + this.opts = Object.assign( + { + namespace: 'keyv', + serialize: JSONB.stringify, + deserialize: JSONB.parse + }, + (typeof uri === 'string') ? { uri } : uri, + opts + ); + if (!this.opts.store) { + const adapterOpts = Object.assign({}, this.opts); + this.opts.store = loadStore(adapterOpts); + } -/***/ }), + if (typeof this.opts.store.on === 'function') { + this.opts.store.on('error', err => this.emit('error', err)); + } -/***/ 79130: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + this.opts.store.namespace = this.opts.namespace; + } + + _getKeyPrefix(key) { + return `${this.opts.namespace}:${key}`; + } -var nativeCreate = __webpack_require__(36786); + get(key) { + key = this._getKeyPrefix(key); + const store = this.opts.store; + return Promise.resolve() + .then(() => store.get(key)) + .then(data => { + data = (typeof data === 'string') ? this.opts.deserialize(data) : data; + if (data === undefined) { + return undefined; + } + if (typeof data.expires === 'number' && Date.now() > data.expires) { + this.delete(key); + return undefined; + } + return data.value; + }); + } -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; + set(key, value, ttl) { + key = this._getKeyPrefix(key); + if (typeof ttl === 'undefined') { + ttl = this.opts.ttl; + } + if (ttl === 0) { + ttl = undefined; + } + const store = this.opts.store; + + return Promise.resolve() + .then(() => { + const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; + value = { value, expires }; + return store.set(key, this.opts.serialize(value), ttl); + }) + .then(() => true); + } + + delete(key) { + key = this._getKeyPrefix(key); + const store = this.opts.store; + return Promise.resolve() + .then(() => store.delete(key)); + } + + clear() { + const store = this.opts.store; + return Promise.resolve() + .then(() => store.clear()); + } } -module.exports = hashClear; +module.exports = Keyv; /***/ }), -/***/ 93067: -/***/ ((module) => { +/***/ 99036: +/***/ ((__unused_webpack_module, exports) => { -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; -} +"use strict"; -module.exports = hashDelete; +var LF = '\n'; +var CR = '\r'; +var LinesAndColumns = (function () { + function LinesAndColumns(string) { + this.string = string; + var offsets = [0]; + for (var offset = 0; offset < string.length;) { + switch (string[offset]) { + case LF: + offset += LF.length; + offsets.push(offset); + break; + case CR: + offset += CR.length; + if (string[offset] === LF) { + offset += LF.length; + } + offsets.push(offset); + break; + default: + offset++; + break; + } + } + this.offsets = offsets; + } + LinesAndColumns.prototype.locationForIndex = function (index) { + if (index < 0 || index > this.string.length) { + return null; + } + var line = 0; + var offsets = this.offsets; + while (offsets[line + 1] <= index) { + line++; + } + var column = index - offsets[line]; + return { line: line, column: column }; + }; + LinesAndColumns.prototype.indexForLocation = function (location) { + var line = location.line, column = location.column; + if (line < 0 || line >= this.offsets.length) { + return null; + } + if (column < 0 || column > this.lengthOfLine(line)) { + return null; + } + return this.offsets[line] + column; + }; + LinesAndColumns.prototype.lengthOfLine = function (line) { + var offset = this.offsets[line]; + var nextOffset = line === this.offsets.length - 1 ? this.string.length : this.offsets[line + 1]; + return nextOffset - offset; + }; + return LinesAndColumns; +}()); +exports.__esModule = true; +exports.default = LinesAndColumns; /***/ }), -/***/ 21098: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 30815: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var nativeCreate = __webpack_require__(36786); +"use strict"; -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +const path = __nccwpck_require__(85622); +const fs = __nccwpck_require__(35747); +const {promisify} = __nccwpck_require__(31669); +const pLocate = __nccwpck_require__(60364); -/** Used for built-in method references. */ -var objectProto = Object.prototype; +const fsStat = promisify(fs.stat); +const fsLStat = promisify(fs.lstat); -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; +function checkType({type}) { + if (type in typeMappings) { + return; + } + + throw new Error(`Invalid type specified: ${type}`); } -module.exports = hashGet; +const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); +module.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: 'file', + allowSymlinks: true, + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fsStat : fsLStat; -/***/ }), + return pLocate(paths, async path_ => { + try { + const stat = await statFn(path.resolve(options.cwd, path_)); + return matchType(options.type, stat); + } catch (_) { + return false; + } + }, options); +}; -/***/ 73949: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +module.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: 'file', + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; -var nativeCreate = __webpack_require__(36786); + for (const path_ of paths) { + try { + const stat = statFn(path.resolve(options.cwd, path_)); -/** Used for built-in method references. */ -var objectProto = Object.prototype; + if (matchType(options.type, stat)) { + return path_; + } + } catch (_) { + } + } +}; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); -} +/***/ }), -module.exports = hashHas; +/***/ 41066: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); -/***/ }), +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); -/***/ 48911: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +module.exports = DataView; -var nativeCreate = __webpack_require__(36786); -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +/***/ }), + +/***/ 30731: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var hashClear = __nccwpck_require__(79130), + hashDelete = __nccwpck_require__(93067), + hashGet = __nccwpck_require__(21098), + hashHas = __nccwpck_require__(73949), + hashSet = __nccwpck_require__(48911); /** - * Sets the hash `key` to `value`. + * Creates a hash object. * * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } -module.exports = hashSet; +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; +module.exports = Hash; -/***/ }), -/***/ 4025: -/***/ ((module) => { +/***/ }), -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/***/ 82746: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var listCacheClear = __nccwpck_require__(52523), + listCacheDelete = __nccwpck_require__(19937), + listCacheGet = __nccwpck_require__(15131), + listCacheHas = __nccwpck_require__(89528), + listCacheSet = __nccwpck_require__(51635); /** - * Initializes an array clone. + * Creates an list cache object. * * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return result; } -module.exports = initCloneArray; +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; /***/ }), -/***/ 27353: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 51105: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var cloneArrayBuffer = __webpack_require__(18384), - cloneDataView = __webpack_require__(8534), - cloneRegExp = __webpack_require__(86549), - cloneSymbol = __webpack_require__(81731), - cloneTypedArray = __webpack_require__(13817); +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; + +/***/ }), + +/***/ 16531: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var mapCacheClear = __nccwpck_require__(3489), + mapCacheDelete = __nccwpck_require__(288), + mapCacheGet = __nccwpck_require__(15712), + mapCacheHas = __nccwpck_require__(80369), + mapCacheSet = __nccwpck_require__(66935); /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * Creates a map cache object to store key-value pairs. * * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; - case boolTag: - case dateTag: - return new Ctor(+object); - case dataViewTag: - return cloneDataView(object, isDeep); +/***/ }), - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); +/***/ 40514: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - case mapTag: - return new Ctor; +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); - case numberTag: - case stringTag: - return new Ctor(object); +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); - case regexpTag: - return cloneRegExp(object); +module.exports = Promise; - case setTag: - return new Ctor; - case symbolTag: - return cloneSymbol(object); - } -} +/***/ }), -module.exports = initCloneByTag; +/***/ 9056: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; /***/ }), -/***/ 66312: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 49754: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var baseCreate = __webpack_require__(14794), - getPrototype = __webpack_require__(63363), - isPrototype = __webpack_require__(4954); +var ListCache = __nccwpck_require__(82746), + stackClear = __nccwpck_require__(22614), + stackDelete = __nccwpck_require__(24202), + stackGet = __nccwpck_require__(96310), + stackHas = __nccwpck_require__(58721), + stackSet = __nccwpck_require__(90320); /** - * Initializes an object clone. + * Creates a stack cache object to store key-value pairs. * * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } -module.exports = initCloneObject; +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; /***/ }), -/***/ 6426: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 39929: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Symbol = __webpack_require__(39929), - isArguments = __webpack_require__(24839), - isArray = __webpack_require__(43364); +var root = __nccwpck_require__(562); /** Built-in value references. */ -var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; - -/** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); -} +var Symbol = root.Symbol; -module.exports = isFlattenable; +module.exports = Symbol; /***/ }), -/***/ 72950: -/***/ ((module) => { +/***/ 81918: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +var root = __nccwpck_require__(562); -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; +module.exports = Uint8Array; - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); -} -module.exports = isIndex; +/***/ }), +/***/ 87243: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var getNative = __nccwpck_require__(76028), + root = __nccwpck_require__(562); -/***/ 78155: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; + + +/***/ }), -var eq = __webpack_require__(28650), - isArrayLike = __webpack_require__(20577), - isIndex = __webpack_require__(72950), - isObject = __webpack_require__(43420); +/***/ 99502: +/***/ ((module) => { /** - * Checks if the given arguments are from an iteratee call. + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. * * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); } - return false; + return func.apply(thisArg, args); } -module.exports = isIterateeCall; +module.exports = apply; /***/ }), -/***/ 20007: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var isArray = __webpack_require__(43364), - isSymbol = __webpack_require__(82500); - -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/; +/***/ 98029: +/***/ ((module) => { /** - * Checks if `value` is a property name and not a property path. + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. * * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); + return array; } -module.exports = isKey; +module.exports = arrayEach; /***/ }), -/***/ 89958: +/***/ 69459: /***/ ((module) => { /** - * Checks if `value` is suitable for use as unique object key. + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; } -module.exports = isKeyable; +module.exports = arrayFilter; /***/ }), -/***/ 16716: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 63360: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var coreJsData = __webpack_require__(54554); +var baseTimes = __nccwpck_require__(15683), + isArguments = __nccwpck_require__(24839), + isArray = __nccwpck_require__(43364), + isBuffer = __nccwpck_require__(12963), + isIndex = __nccwpck_require__(72950), + isTypedArray = __nccwpck_require__(53635); -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `func` has its source masked. + * Creates an array of the enumerable property names of the array-like `value`. * * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; } -module.exports = isMasked; +module.exports = arrayLikeKeys; /***/ }), -/***/ 4954: +/***/ 77680: /***/ ((module) => { -/** Used for built-in method references. */ -var objectProto = Object.prototype; - /** - * Checks if `value` is likely a prototype object. + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); - return value === proto; + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; } -module.exports = isPrototype; +module.exports = arrayMap; /***/ }), -/***/ 52523: +/***/ 52061: /***/ ((module) => { /** - * Removes all key-value entries from the list cache. + * Appends the elements of `values` to `array`. * * @private - * @name clear - * @memberOf ListCache + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. */ -function listCacheClear() { - this.__data__ = []; - this.size = 0; +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; } -module.exports = listCacheClear; +module.exports = arrayPush; /***/ }), -/***/ 19937: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 55647: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var assocIndexOf = __webpack_require__(886); +var baseAssignValue = __nccwpck_require__(71850), + eq = __nccwpck_require__(28650); /** Used for built-in method references. */ -var arrayProto = Array.prototype; +var objectProto = Object.prototype; -/** Built-in value references. */ -var splice = arrayProto.splice; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Removes `key` and its value from the list cache. + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } - --this.size; - return true; } -module.exports = listCacheDelete; +module.exports = assignValue; /***/ }), -/***/ 15131: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 886: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var assocIndexOf = __webpack_require__(886); +var eq = __nccwpck_require__(28650); /** - * Gets the list cache value for `key`. + * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; } -module.exports = listCacheGet; +module.exports = assocIndexOf; /***/ }), -/***/ 89528: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 57361: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var assocIndexOf = __webpack_require__(886); +var copyObject = __nccwpck_require__(83568), + keys = __nccwpck_require__(50288); /** - * Checks if a list cache value for `key` exists. + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. * * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); } -module.exports = listCacheHas; +module.exports = baseAssign; /***/ }), -/***/ 51635: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 86677: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var assocIndexOf = __webpack_require__(886); +var copyObject = __nccwpck_require__(83568), + keysIn = __nccwpck_require__(86032); /** - * Sets the list cache `key` to `value`. + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. * * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); } -module.exports = listCacheSet; +module.exports = baseAssignIn; /***/ }), -/***/ 3489: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 71850: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Hash = __webpack_require__(30731), - ListCache = __webpack_require__(82746), - Map = __webpack_require__(51105); +var defineProperty = __nccwpck_require__(59252); /** - * Removes all key-value entries from the map. + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. * * @private - * @name clear - * @memberOf MapCache + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } } -module.exports = mapCacheClear; +module.exports = baseAssignValue; /***/ }), -/***/ 288: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 95570: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Stack = __nccwpck_require__(49754), + arrayEach = __nccwpck_require__(98029), + assignValue = __nccwpck_require__(55647), + baseAssign = __nccwpck_require__(57361), + baseAssignIn = __nccwpck_require__(86677), + cloneBuffer = __nccwpck_require__(82009), + copyArray = __nccwpck_require__(76640), + copySymbols = __nccwpck_require__(85337), + copySymbolsIn = __nccwpck_require__(93017), + getAllKeys = __nccwpck_require__(18785), + getAllKeysIn = __nccwpck_require__(54296), + getTag = __nccwpck_require__(207), + initCloneArray = __nccwpck_require__(4025), + initCloneByTag = __nccwpck_require__(27353), + initCloneObject = __nccwpck_require__(66312), + isArray = __nccwpck_require__(43364), + isBuffer = __nccwpck_require__(12963), + isMap = __nccwpck_require__(13689), + isObject = __nccwpck_require__(43420), + isSet = __nccwpck_require__(81360), + keys = __nccwpck_require__(50288), + keysIn = __nccwpck_require__(86032); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; -var getMapData = __webpack_require__(71198); +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; /** - * Removes `key` and its value from the map. + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. * * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. */ -function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; -} - -module.exports = mapCacheDelete; +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; -/***/ }), + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); -/***/ 15712: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } -var getMapData = __webpack_require__(71198); + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; } -module.exports = mapCacheGet; +module.exports = baseClone; /***/ }), -/***/ 80369: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 14794: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isObject = __nccwpck_require__(43420); -var getMapData = __webpack_require__(71198); +/** Built-in value references. */ +var objectCreate = Object.create; /** - * Checks if a map value for `key` exists. + * The base implementation of `_.create` without support for assigning + * properties to the created object. * * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); -module.exports = mapCacheHas; +module.exports = baseCreate; /***/ }), -/***/ 66935: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 5765: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var getMapData = __webpack_require__(71198); +var arrayPush = __nccwpck_require__(52061), + isFlattenable = __nccwpck_require__(6426); /** - * Sets the map `key` to `value`. + * The base implementation of `_.flatten` with support for restricting flattening. * * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. */ -function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; } -module.exports = mapCacheSet; +module.exports = baseFlatten; /***/ }), -/***/ 46717: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var memoize = __webpack_require__(89058); +/***/ 86685: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used as the maximum memoize cache size. */ -var MAX_MEMOIZE_SIZE = 500; +var castPath = __nccwpck_require__(18963), + toKey = __nccwpck_require__(30668); /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * The base implementation of `_.get` without support for default values. * * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. */ -function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; -} - -module.exports = memoizeCapped; - - -/***/ }), - -/***/ 36786: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function baseGet(object, path) { + path = castPath(path, object); -var getNative = __webpack_require__(76028); + var index = 0, + length = path.length; -/* Built-in method references that are verified to be native. */ -var nativeCreate = getNative(Object, 'create'); + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} -module.exports = nativeCreate; +module.exports = baseGet; /***/ }), -/***/ 11491: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var overArg = __webpack_require__(90570); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); - -module.exports = nativeKeys; - - -/***/ }), +/***/ 98160: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ 43101: -/***/ ((module) => { +var arrayPush = __nccwpck_require__(52061), + isArray = __nccwpck_require__(43364); /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. * * @private * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. */ -function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } -module.exports = nativeKeysIn; +module.exports = baseGetAllKeys; /***/ }), -/***/ 62470: -/***/ ((module, exports, __webpack_require__) => { - -/* module decorator */ module = __webpack_require__.nmd(module); -var freeGlobal = __webpack_require__(37825); - -/** Detect free variable `exports`. */ -var freeExports = true && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -module.exports = nodeUtil; - - -/***/ }), +/***/ 98653: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ 49052: -/***/ ((module) => { +var Symbol = __nccwpck_require__(39929), + getRawTag = __nccwpck_require__(32608), + objectToString = __nccwpck_require__(49052); -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** - * Converts `value` to a string using `Object.prototype.toString`. + * The base implementation of `getTag` without fallbacks for buggy environments. * * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ -function objectToString(value) { - return nativeObjectToString.call(value); +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); } -module.exports = objectToString; +module.exports = baseGetTag; /***/ }), -/***/ 90570: +/***/ 56263: /***/ ((module) => { /** - * Creates a unary function that invokes `func` with its argument transformed. + * The base implementation of `_.hasIn` without support for deep paths. * * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; +function baseHasIn(object, key) { + return object != null && key in Object(object); } -module.exports = overArg; +module.exports = baseHasIn; /***/ }), -/***/ 216: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 77907: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var apply = __webpack_require__(99502); +var baseGetTag = __nccwpck_require__(98653), + isObjectLike = __nccwpck_require__(9111); -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; /** - * A specialized version of `baseRest` which transforms the rest array. + * The base implementation of `_.isArguments`. * * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ -function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } -module.exports = overRest; +module.exports = baseIsArguments; /***/ }), -/***/ 562: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var freeGlobal = __webpack_require__(37825); - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -module.exports = root; - - -/***/ }), +/***/ 81391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ 65444: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var getTag = __nccwpck_require__(207), + isObjectLike = __nccwpck_require__(9111); -var baseSetToString = __webpack_require__(3503), - shortOut = __webpack_require__(10697); +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; /** - * Sets the `toString` method of `func` to return `string`. + * The base implementation of `_.isMap` without Node.js optimizations. * * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ -var setToString = shortOut(baseSetToString); +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} -module.exports = setToString; +module.exports = baseIsMap; /***/ }), -/***/ 10697: -/***/ ((module) => { - -/** Used to detect hot functions by number of calls within a span of milliseconds. */ -var HOT_COUNT = 800, - HOT_SPAN = 16; +/***/ 72294: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeNow = Date.now; +var isFunction = __nccwpck_require__(66827), + isMasked = __nccwpck_require__(16716), + isObject = __nccwpck_require__(43420), + toSource = __nccwpck_require__(98241); /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ -function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; -} +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -module.exports = shortOut; +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; -/***/ }), +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; -/***/ 22614: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -var ListCache = __webpack_require__(82746); +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); /** - * Removes all key-value entries from the stack. + * The base implementation of `_.isNative` without bad shim checks. * * @private - * @name clear - * @memberOf Stack + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. */ -function stackClear() { - this.__data__ = new ListCache; - this.size = 0; +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } -module.exports = stackClear; +module.exports = baseIsNative; /***/ }), -/***/ 24202: -/***/ ((module) => { +/***/ 19472: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var getTag = __nccwpck_require__(207), + isObjectLike = __nccwpck_require__(9111); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; /** - * Removes `key` and its value from the stack. + * The base implementation of `_.isSet` without Node.js optimizations. * * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ -function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; } -module.exports = stackDelete; +module.exports = baseIsSet; /***/ }), -/***/ 96310: -/***/ ((module) => { +/***/ 86944: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseGetTag = __nccwpck_require__(98653), + isLength = __nccwpck_require__(55752), + isObjectLike = __nccwpck_require__(9111); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; /** - * Gets the stack value for `key`. + * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ -function stackGet(key) { - return this.__data__.get(key); +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } -module.exports = stackGet; +module.exports = baseIsTypedArray; /***/ }), -/***/ 58721: -/***/ ((module) => { +/***/ 24787: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var isPrototype = __nccwpck_require__(4954), + nativeKeys = __nccwpck_require__(11491); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if a stack value for `key` exists. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -function stackHas(key) { - return this.__data__.has(key); +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; } -module.exports = stackHas; +module.exports = baseKeys; /***/ }), -/***/ 90320: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 14535: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var ListCache = __webpack_require__(82746), - Map = __webpack_require__(51105), - MapCache = __webpack_require__(16531); +var isObject = __nccwpck_require__(43420), + isPrototype = __nccwpck_require__(4954), + nativeKeysIn = __nccwpck_require__(43101); -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Sets the stack `key` to `value`. + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); } - data = this.__data__ = new MapCache(pairs); } - data.set(key, value); - this.size = data.size; - return this; + return result; } -module.exports = stackSet; +module.exports = baseKeysIn; /***/ }), -/***/ 35725: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var memoizeCapped = __webpack_require__(46717); - -/** Used to match property names within property paths. */ -var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; +/***/ 3529: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; +var basePickBy = __nccwpck_require__(85041), + hasIn = __nccwpck_require__(14426); /** - * Converts `string` to a property path array. + * The base implementation of `_.pick` without support for individual + * property identifiers. * * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. */ -var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); }); - return result; -}); +} -module.exports = stringToPath; +module.exports = basePick; /***/ }), -/***/ 30668: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var isSymbol = __webpack_require__(82500); +/***/ 85041: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; +var baseGet = __nccwpck_require__(86685), + baseSet = __nccwpck_require__(90374), + castPath = __nccwpck_require__(18963); /** - * Converts `value` to a string key if it's not a string or symbol. + * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + return result; } -module.exports = toKey; +module.exports = basePickBy; /***/ }), -/***/ 98241: -/***/ ((module) => { - -/** Used for built-in method references. */ -var funcProto = Function.prototype; +/***/ 31428: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +var identity = __nccwpck_require__(57460), + overRest = __nccwpck_require__(216), + setToString = __nccwpck_require__(65444); /** - * Converts `func` to its source code. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); } -module.exports = toSource; +module.exports = baseRest; /***/ }), -/***/ 66690: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var assignValue = __webpack_require__(55647), - copyObject = __webpack_require__(83568), - createAssigner = __webpack_require__(21479), - isArrayLike = __webpack_require__(20577), - isPrototype = __webpack_require__(4954), - keys = __webpack_require__(50288); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/***/ 90374: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var assignValue = __nccwpck_require__(55647), + castPath = __nccwpck_require__(18963), + isIndex = __nccwpck_require__(72950), + isObject = __nccwpck_require__(43420), + toKey = __nccwpck_require__(30668); /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). + * The base implementation of `_.set`. * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } */ -var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } } + assignValue(nested, key, newValue); + nested = nested[key]; } -}); + return object; +} -module.exports = assign; +module.exports = baseSet; /***/ }), -/***/ 31471: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseClone = __webpack_require__(95570); +/***/ 3503: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to compose bitmasks for cloning. */ -var CLONE_SYMBOLS_FLAG = 4; +var constant = __nccwpck_require__(66915), + defineProperty = __nccwpck_require__(59252), + identity = __nccwpck_require__(57460); /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * The base implementation of `setToString` without support for hot loop shorting. * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. */ -function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); -} +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; -module.exports = clone; +module.exports = baseSetToString; /***/ }), -/***/ 66915: +/***/ 15683: /***/ ((module) => { /** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. * - * console.log(objects[0] === objects[1]); - * // => true + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. */ -function constant(value) { - return function() { - return value; - }; +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; } -module.exports = constant; +module.exports = baseTimes; /***/ }), -/***/ 28650: -/***/ ((module) => { +/***/ 74851: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Symbol = __nccwpck_require__(39929), + arrayMap = __nccwpck_require__(77680), + isArray = __nccwpck_require__(43364), + isSymbol = __nccwpck_require__(82500); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. * - * _.eq(NaN, NaN); - * // => true + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. */ -function eq(value, other) { - return value === other || (value !== value && other !== other); +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } -module.exports = eq; +module.exports = baseToString; /***/ }), -/***/ 8708: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseFlatten = __webpack_require__(5765); +/***/ 83717: +/***/ ((module) => { /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example + * The base implementation of `_.unary` without support for storing metadata. * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. */ -function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; +function baseUnary(func) { + return function(value) { + return func(value); + }; } -module.exports = flatten; +module.exports = baseUnary; /***/ }), -/***/ 14426: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 18963: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var baseHasIn = __webpack_require__(56263), - hasPath = __webpack_require__(23144); +var isArray = __nccwpck_require__(43364), + isKey = __nccwpck_require__(20007), + stringToPath = __nccwpck_require__(35725), + toString = __nccwpck_require__(49228); /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true + * Casts `value` to a path array if it's not one. * - * _.hasIn(object, 'b'); - * // => false + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. */ -function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); } -module.exports = hasIn; +module.exports = castPath; /***/ }), -/***/ 57460: -/***/ ((module) => { +/***/ 18384: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Uint8Array = __nccwpck_require__(81918); /** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; + * Creates a clone of `arrayBuffer`. * - * console.log(_.identity(object) === object); - * // => true + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. */ -function identity(value) { - return value; +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; } -module.exports = identity; +module.exports = cloneArrayBuffer; /***/ }), -/***/ 24839: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 82009: +/***/ ((module, exports, __nccwpck_require__) => { -var baseIsArguments = __webpack_require__(77907), - isObjectLike = __webpack_require__(9111); +/* module decorator */ module = __nccwpck_require__.nmd(module); +var root = __nccwpck_require__(562); -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true + * Creates a clone of `buffer`. * - * _.isArguments([1, 2, 3]); - * // => false + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); -module.exports = isArguments; + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; /***/ }), -/***/ 43364: -/***/ ((module) => { +/***/ 8534: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var cloneArrayBuffer = __nccwpck_require__(18384); /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false + * Creates a clone of `dataView`. * - * _.isArray(_.noop); - * // => false + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. */ -var isArray = Array.isArray; +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} -module.exports = isArray; +module.exports = cloneDataView; /***/ }), -/***/ 20577: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 86549: +/***/ ((module) => { -var isFunction = __webpack_require__(66827), - isLength = __webpack_require__(55752); +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true + * Creates a clone of `regexp`. * - * _.isArrayLike(_.noop); - * // => false + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; } -module.exports = isArrayLike; +module.exports = cloneRegExp; /***/ }), -/***/ 12963: -/***/ ((module, exports, __webpack_require__) => { +/***/ 81731: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* module decorator */ module = __webpack_require__.nmd(module); -var root = __webpack_require__(562), - stubFalse = __webpack_require__(90377); +var Symbol = __nccwpck_require__(39929); -/** Detect free variable `exports`. */ -var freeExports = true && exports && !exports.nodeType && exports; +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; +module.exports = cloneSymbol; -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; +/***/ }), + +/***/ 13817: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var cloneArrayBuffer = __nccwpck_require__(18384); /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true + * Creates a clone of `typedArray`. * - * _.isBuffer(new Uint8Array(2)); - * // => false + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. */ -var isBuffer = nativeIsBuffer || stubFalse; +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} -module.exports = isBuffer; +module.exports = cloneTypedArray; /***/ }), -/***/ 66827: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseGetTag = __webpack_require__(98653), - isObject = __webpack_require__(43420); - -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - proxyTag = '[object Proxy]'; +/***/ 76640: +/***/ ((module) => { /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true + * Copies the values of `source` to `array`. * - * _.isFunction(/abc/); - * // => false + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. */ -function isFunction(value) { - if (!isObject(value)) { - return false; +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + return array; } -module.exports = isFunction; +module.exports = copyArray; /***/ }), -/***/ 55752: -/***/ ((module) => { +/***/ 83568: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +var assignValue = __nccwpck_require__(55647), + baseAssignValue = __nccwpck_require__(71850); /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false + * Copies properties of `source` to `object`. * - * _.isLength('3'); - * // => false + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; } -module.exports = isLength; +module.exports = copyObject; /***/ }), -/***/ 13689: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseIsMap = __webpack_require__(81391), - baseUnary = __webpack_require__(83717), - nodeUtil = __webpack_require__(62470); +/***/ 85337: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* Node.js helper references. */ -var nodeIsMap = nodeUtil && nodeUtil.isMap; +var copyObject = __nccwpck_require__(83568), + getSymbols = __nccwpck_require__(5841); /** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true + * Copies own symbols of `source` to `object`. * - * _.isMap(new WeakMap); - * // => false + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. */ -var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} -module.exports = isMap; +module.exports = copySymbols; /***/ }), -/***/ 43420: -/***/ ((module) => { +/***/ 93017: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var copyObject = __nccwpck_require__(83568), + getSymbolsIn = __nccwpck_require__(85468); /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true + * Copies own and inherited symbols of `source` to `object`. * - * _.isObject(null); - * // => false + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); } -module.exports = isObject; +module.exports = copySymbolsIn; /***/ }), -/***/ 9111: -/***/ ((module) => { +/***/ 54554: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var root = __nccwpck_require__(562); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), + +/***/ 21479: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseRest = __nccwpck_require__(31428), + isIterateeCall = __nccwpck_require__(78155); /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false + * Creates a function like `_.assign`. * - * _.isObjectLike(null); - * // => false + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); } -module.exports = isObjectLike; +module.exports = createAssigner; /***/ }), -/***/ 81360: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 59252: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var baseIsSet = __webpack_require__(19472), - baseUnary = __webpack_require__(83717), - nodeUtil = __webpack_require__(62470); +var getNative = __nccwpck_require__(76028); -/* Node.js helper references. */ -var nodeIsSet = nodeUtil && nodeUtil.isSet; +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), + +/***/ 34800: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var flatten = __nccwpck_require__(8708), + overRest = __nccwpck_require__(216), + setToString = __nccwpck_require__(65444); /** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true + * A specialized version of `baseRest` which flattens the rest array. * - * _.isSet(new WeakSet); - * // => false + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. */ -var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} -module.exports = isSet; +module.exports = flatRest; /***/ }), -/***/ 82500: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 37825: +/***/ ((module) => { -var baseGetTag = __webpack_require__(98653), - isObjectLike = __webpack_require__(9111); +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; +module.exports = freeGlobal; + + +/***/ }), + +/***/ 18785: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var baseGetAllKeys = __nccwpck_require__(98160), + getSymbols = __nccwpck_require__(5841), + keys = __nccwpck_require__(50288); /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true + * Creates an array of own enumerable property names and symbols of `object`. * - * _.isSymbol('abc'); - * // => false + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); } -module.exports = isSymbol; +module.exports = getAllKeys; /***/ }), -/***/ 53635: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var baseIsTypedArray = __webpack_require__(86944), - baseUnary = __webpack_require__(83717), - nodeUtil = __webpack_require__(62470); +/***/ 54296: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; +var baseGetAllKeys = __nccwpck_require__(98160), + getSymbolsIn = __nccwpck_require__(85468), + keysIn = __nccwpck_require__(86032); /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. * - * _.isTypedArray([]); - * // => false + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} -module.exports = isTypedArray; +module.exports = getAllKeysIn; /***/ }), -/***/ 50288: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 71198: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var arrayLikeKeys = __webpack_require__(63360), - baseKeys = __webpack_require__(24787), - isArrayLike = __webpack_require__(20577); +var isKeyable = __nccwpck_require__(89958); /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) + * Gets the data for `map`. * - * _.keys('hi'); - * // => ['0', '1'] + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; } -module.exports = keys; +module.exports = getMapData; /***/ }), -/***/ 86032: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 76028: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var arrayLikeKeys = __webpack_require__(63360), - baseKeysIn = __webpack_require__(14535), - isArrayLike = __webpack_require__(20577); +var baseIsNative = __nccwpck_require__(72294), + getValue = __nccwpck_require__(64413); /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. + * Gets the native function at `key` of `object`. * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object + * @private * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ -function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; } -module.exports = keysIn; +module.exports = getNative; /***/ }), -/***/ 89058: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var MapCache = __webpack_require__(16531); +/***/ 63363: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; +var overArg = __nccwpck_require__(90570); -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; -} +module.exports = getPrototype; -// Expose `MapCache`. -memoize.Cache = MapCache; -module.exports = memoize; +/***/ }), +/***/ 32608: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var Symbol = __nccwpck_require__(39929); -/***/ 53651: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/** Used for built-in method references. */ +var objectProto = Object.prototype; -var basePick = __webpack_require__(3529), - flatRest = __webpack_require__(34800); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. */ -var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); -}); - -module.exports = pick; - - -/***/ }), +var nativeObjectToString = objectProto.toString; -/***/ 87632: -/***/ ((module) => { +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * - * console.log(arrays[0] === arrays[1]); - * // => false + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. */ -function stubArray() { - return []; +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; } -module.exports = stubArray; +module.exports = getRawTag; /***/ }), -/***/ 90377: -/***/ ((module) => { +/***/ 5841: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var arrayFilter = __nccwpck_require__(69459), + stubArray = __nccwpck_require__(87632); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; /** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example + * Creates an array of the own enumerable symbols of `object`. * - * _.times(2, _.stubFalse); - * // => [false, false] + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. */ -function stubFalse() { - return false; -} +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; -module.exports = stubFalse; +module.exports = getSymbols; /***/ }), -/***/ 49228: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 85468: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var baseToString = __webpack_require__(74851); +var arrayPush = __nccwpck_require__(52061), + getPrototype = __nccwpck_require__(63363), + getSymbols = __nccwpck_require__(5841), + stubArray = __nccwpck_require__(87632); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' + * Creates an array of the own and inherited enumerable symbols of `object`. * - * _.toString([1, 2, 3]); - * // => '1,2,3' + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. */ -function toString(value) { - return value == null ? '' : baseToString(value); -} +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; -module.exports = toString; +module.exports = getSymbolsIn; /***/ }), -/***/ 87279: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 207: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var DataView = __nccwpck_require__(41066), + Map = __nccwpck_require__(51105), + Promise = __nccwpck_require__(40514), + Set = __nccwpck_require__(9056), + WeakMap = __nccwpck_require__(87243), + baseGetTag = __nccwpck_require__(98653), + toSource = __nccwpck_require__(98241); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; -const chalk = __webpack_require__(22607); +var dataViewTag = '[object DataView]'; -const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); -const main = { - info: chalk.blue('ℹ'), - success: chalk.green('✔'), - warning: chalk.yellow('⚠'), - error: chalk.red('✖') -}; +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; -const fallbacks = { - info: chalk.blue('i'), - success: chalk.green('√'), - warning: chalk.yellow('‼'), - error: chalk.red('×') -}; +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; -module.exports = isSupported ? main : fallbacks; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; /***/ }), -/***/ 22607: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 64413: +/***/ ((module) => { -"use strict"; +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} -const ansiStyles = __webpack_require__(58588); -const {stdout: stdoutColor, stderr: stderrColor} = __webpack_require__(28106); -const { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -} = __webpack_require__(78984); +module.exports = getValue; -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = [ - 'ansi', - 'ansi', - 'ansi256', - 'ansi16m' -]; -const styles = Object.create(null); +/***/ }), -const applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error('The `level` option should be an integer from 0 to 3'); - } +/***/ 23144: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Detect level if not set manually - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === undefined ? colorLevel : options.level; -}; +var castPath = __nccwpck_require__(18963), + isArguments = __nccwpck_require__(24839), + isArray = __nccwpck_require__(43364), + isIndex = __nccwpck_require__(72950), + isLength = __nccwpck_require__(55752), + toKey = __nccwpck_require__(30668); -class ChalkClass { - constructor(options) { - // eslint-disable-next-line no-constructor-return - return chalkFactory(options); - } -} +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); -const chalkFactory = options => { - const chalk = {}; - applyOptions(chalk, options); + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} - chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); +module.exports = hasPath; - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - chalk.template.constructor = () => { - throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); - }; +/***/ }), - chalk.template.Instance = ChalkClass; +/***/ 79130: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return chalk.template; -}; +var nativeCreate = __nccwpck_require__(36786); -function Chalk(options) { - return chalkFactory(options); +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } -for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, {value: builder}); - return builder; - } - }; -} +module.exports = hashClear; -styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, 'visible', {value: builder}); - return builder; - } -}; -const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; +/***/ }), -for (const model of usedModels) { - styles[model] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} +/***/ 93067: +/***/ ((module) => { -for (const model of usedModels) { - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; } -const proto = Object.defineProperties(() => {}, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; - } - } -}); - -const createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === undefined) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } +module.exports = hashDelete; - return { - open, - close, - openAll, - closeAll, - parent - }; -}; -const createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - // Single argument is hot path, implicit coercion is faster than anything - // eslint-disable-next-line no-implicit-coercion - return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); - }; +/***/ }), - // We alter the prototype because we must return a function, but there is - // no way to create a function with a different prototype - Object.setPrototypeOf(builder, proto); +/***/ 21098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; +var nativeCreate = __nccwpck_require__(36786); - return builder; -}; +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; -const applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? '' : string; - } +/** Used for built-in method references. */ +var objectProto = Object.prototype; - let styler = self._styler; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - if (styler === undefined) { - return string; - } +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} - const {openAll, closeAll} = styler; - if (string.indexOf('\u001B') !== -1) { - while (styler !== undefined) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - string = stringReplaceAll(string, styler.close, styler.open); +module.exports = hashGet; - styler = styler.parent; - } - } - // We can move both next actions out of loop, because remaining actions in loop won't have - // any/visible effect on parts we add here. Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 - const lfIndex = string.indexOf('\n'); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } +/***/ }), - return openAll + string + closeAll; -}; +/***/ 73949: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -let template; -const chalkTag = (chalk, ...strings) => { - const [firstString] = strings; +var nativeCreate = __nccwpck_require__(36786); - if (!Array.isArray(firstString)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return strings.join(' '); - } +/** Used for built-in method references. */ +var objectProto = Object.prototype; - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), - String(firstString.raw[i]) - ); - } +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} - if (template === undefined) { - template = __webpack_require__(55790); - } +module.exports = hashHas; - return template(chalk, parts.join('')); -}; -Object.defineProperties(Chalk.prototype, styles); +/***/ }), -const chalk = Chalk(); // eslint-disable-line new-cap -chalk.supportsColor = stdoutColor; -chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap -chalk.stderr.supportsColor = stderrColor; +/***/ 48911: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = chalk; +var nativeCreate = __nccwpck_require__(36786); +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; -/***/ }), +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} -/***/ 55790: -/***/ ((module) => { +module.exports = hashSet; -"use strict"; -const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; +/***/ }), -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); +/***/ 4025: +/***/ ((module) => { -function unescape(c) { - const u = c[0] === 'u'; - const bracket = c[1] === '{'; +/** Used for built-in method references. */ +var objectProto = Object.prototype; - if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); - return ESCAPES.get(c) || c; + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; } -function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; - - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } +module.exports = initCloneArray; - return results; -} -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; +/***/ }), - const results = []; - let matches; +/***/ 27353: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; +var cloneArrayBuffer = __nccwpck_require__(18384), + cloneDataView = __nccwpck_require__(8534), + cloneRegExp = __nccwpck_require__(86549), + cloneSymbol = __nccwpck_require__(81731), + cloneTypedArray = __nccwpck_require__(13817); - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } - } +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; - return results; -} +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; -function buildStyle(chalk, styles) { - const enabled = {}; +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } + case boolTag: + case dateTag: + return new Ctor(+object); - let current = chalk; - for (const [styleName, styles] of Object.entries(enabled)) { - if (!Array.isArray(styles)) { - continue; - } + case dataViewTag: + return cloneDataView(object, isDeep); - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); - current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; - } + case mapTag: + return new Ctor; - return current; -} + case numberTag: + case stringTag: + return new Ctor(object); -module.exports = (chalk, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; + case regexpTag: + return cloneRegExp(object); - // eslint-disable-next-line max-params - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape(escapeCharacter)); - } else if (style) { - const string = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } + case setTag: + return new Ctor; - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); + case symbolTag: + return cloneSymbol(object); + } +} - chunks.push(chunk.join('')); +module.exports = initCloneByTag; - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMessage); - } - return chunks.join(''); -}; +/***/ }), +/***/ 66312: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var baseCreate = __nccwpck_require__(14794), + getPrototype = __nccwpck_require__(63363), + isPrototype = __nccwpck_require__(4954); -/***/ 78984: -/***/ ((module) => { +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} -"use strict"; +module.exports = initCloneObject; -const stringReplaceAll = (string, substring, replacer) => { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } +/***/ }), - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ''; - do { - returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); +/***/ 6426: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - returnValue += string.substr(endIndex); - return returnValue; -}; +var Symbol = __nccwpck_require__(39929), + isArguments = __nccwpck_require__(24839), + isArray = __nccwpck_require__(43364); -const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ''; - do { - const gotCR = string[index - 1] === '\r'; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; - endIndex = index + 1; - index = string.indexOf('\n', endIndex); - } while (index !== -1); +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; - returnValue += string.substr(endIndex); - return returnValue; -}; +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} -module.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -}; +module.exports = isFlattenable; /***/ }), -/***/ 18984: +/***/ 72950: /***/ ((module) => { -"use strict"; +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; -module.exports = function (obj) { - var ret = {}; - var keys = Object.keys(Object(obj)); +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; - for (var i = 0; i < keys.length; i++) { - ret[keys[i].toLowerCase()] = obj[keys[i]]; - } +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; - return ret; -}; + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; /***/ }), -/***/ 90293: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 78155: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var eq = __nccwpck_require__(28650), + isArrayLike = __nccwpck_require__(20577), + isIndex = __nccwpck_require__(72950), + isObject = __nccwpck_require__(43420); -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const {promisify} = __webpack_require__(31669); -const semver = __webpack_require__(41124); +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} -const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); +module.exports = isIterateeCall; -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); - if (pathHasInvalidWinCharacters) { - const error = new Error(`Path contains invalid characters: ${pth}`); - error.code = 'EINVAL'; - throw error; - } - } -}; +/***/ }), -const processOptions = options => { - // https://github.com/sindresorhus/make-dir/issues/18 - const defaults = { - mode: 0o777, - fs - }; +/***/ 20007: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return { - ...defaults, - ...options - }; -}; +var isArray = __nccwpck_require__(43364), + isSymbol = __nccwpck_require__(82500); -const permissionError = pth => { - // This replicates the exception of `fs.mkdir` with native the - // `recusive` option when run on an invalid drive under Windows. - const error = new Error(`operation not permitted, mkdir '${pth}'`); - error.code = 'EPERM'; - error.errno = -4048; - error.path = pth; - error.syscall = 'mkdir'; - return error; -}; +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; -const makeDir = async (input, options) => { - checkPath(input); - options = processOptions(options); +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} - const mkdir = promisify(options.fs.mkdir); - const stat = promisify(options.fs.stat); +module.exports = isKey; - if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) { - const pth = path.resolve(input); - await mkdir(pth, { - mode: options.mode, - recursive: true - }); +/***/ }), - return pth; - } +/***/ 89958: +/***/ ((module) => { - const make = async pth => { - try { - await mkdir(pth, options.mode); +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} - return pth; - } catch (error) { - if (error.code === 'EPERM') { - throw error; - } +module.exports = isKeyable; - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth); - } - if (error.message.includes('null bytes')) { - throw error; - } +/***/ }), - await make(path.dirname(pth)); +/***/ 16716: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return make(pth); - } +var coreJsData = __nccwpck_require__(54554); - try { - const stats = await stat(pth); - if (!stats.isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw error; - } +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); - return pth; - } - }; +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} - return make(path.resolve(input)); -}; +module.exports = isMasked; -module.exports = makeDir; -module.exports.sync = (input, options) => { - checkPath(input); - options = processOptions(options); +/***/ }), - if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { - const pth = path.resolve(input); +/***/ 4954: +/***/ ((module) => { - fs.mkdirSync(pth, { - mode: options.mode, - recursive: true - }); +/** Used for built-in method references. */ +var objectProto = Object.prototype; - return pth; - } +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - const make = pth => { - try { - options.fs.mkdirSync(pth, options.mode); - } catch (error) { - if (error.code === 'EPERM') { - throw error; - } + return value === proto; +} - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth); - } +module.exports = isPrototype; - if (error.message.includes('null bytes')) { - throw error; - } - make(path.dirname(pth)); - return make(pth); - } +/***/ }), - try { - if (!options.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw error; - } - } +/***/ 52523: +/***/ ((module) => { - return pth; - }; +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} - return make(path.resolve(input)); -}; +module.exports = listCacheClear; /***/ }), -/***/ 41124: -/***/ ((module, exports) => { - -exports = module.exports = SemVer - -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) - } -} else { - debug = function () {} -} +/***/ 19937: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' +var assocIndexOf = __nccwpck_require__(886); -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 +/** Used for built-in method references. */ +var arrayProto = Array.prototype; -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 +/** Built-in value references. */ +var splice = arrayProto.splice; -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var t = exports.tokens = {} -var R = 0 +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); -function tok (n) { - t[n] = R++ + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; } -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. +module.exports = listCacheDelete; -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. -tok('NUMERICIDENTIFIER') -src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' -tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' +/***/ }), -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. +/***/ 15131: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' +var assocIndexOf = __nccwpck_require__(886); -// ## Main Version -// Three dot-separated numeric identifiers. +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); -tok('MAINVERSION') -src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')' + return index < 0 ? undefined : data[index][1]; +} -tok('MAINVERSIONLOOSE') -src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' +module.exports = listCacheGet; -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. -tok('PRERELEASEIDENTIFIER') -src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' +/***/ }), -tok('PRERELEASEIDENTIFIERLOOSE') -src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' +/***/ 89528: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. +var assocIndexOf = __nccwpck_require__(886); -tok('PRERELEASE') -src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} -tok('PRERELEASELOOSE') -src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' +module.exports = listCacheHas; -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. -tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' +/***/ }), -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. +/***/ 51635: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -tok('BUILD') -src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + - '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' +var assocIndexOf = __nccwpck_require__(886); -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} -tok('FULL') -tok('FULLPLAIN') -src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + - src[t.PRERELEASE] + '?' + - src[t.BUILD] + '?' +module.exports = listCacheSet; -src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -tok('LOOSEPLAIN') -src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + - src[t.PRERELEASELOOSE] + '?' + - src[t.BUILD] + '?' +/***/ }), -tok('LOOSE') -src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' +/***/ 3489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -tok('GTLT') -src[t.GTLT] = '((?:<|>)?=?)' +var Hash = __nccwpck_require__(30731), + ListCache = __nccwpck_require__(82746), + Map = __nccwpck_require__(51105); -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -tok('XRANGEIDENTIFIERLOOSE') -src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -tok('XRANGEIDENTIFIER') -src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} -tok('XRANGEPLAIN') -src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:' + src[t.PRERELEASE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' +module.exports = mapCacheClear; -tok('XRANGEPLAINLOOSE') -src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[t.PRERELEASELOOSE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' -tok('XRANGE') -src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' -tok('XRANGELOOSE') -src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' +/***/ }), -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -tok('COERCE') -src[t.COERCE] = '(^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' -tok('COERCERTL') -re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +/***/ 288: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Tilde ranges. -// Meaning is "reasonably at or greater than" -tok('LONETILDE') -src[t.LONETILDE] = '(?:~>?)' +var getMapData = __nccwpck_require__(71198); -tok('TILDETRIM') -src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' -re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') -var tildeTrimReplace = '$1~' +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} -tok('TILDE') -src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' -tok('TILDELOOSE') -src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' +module.exports = mapCacheDelete; -// Caret ranges. -// Meaning is "at least and backwards compatible with" -tok('LONECARET') -src[t.LONECARET] = '(?:\\^)' -tok('CARETTRIM') -src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' -re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') -var caretTrimReplace = '$1^' +/***/ }), -tok('CARET') -src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' -tok('CARETLOOSE') -src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' +/***/ 15712: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// A simple gt/lt/eq thing, or just "" to indicate "any version" -tok('COMPARATORLOOSE') -src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' -tok('COMPARATOR') -src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' +var getMapData = __nccwpck_require__(71198); -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -tok('COMPARATORTRIM') -src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + - '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} -// this one has to use the /g flag -re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' +module.exports = mapCacheGet; -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -tok('HYPHENRANGE') -src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAIN] + ')' + - '\\s*$' -tok('HYPHENRANGELOOSE') -src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s*$' +/***/ }), -// Star ranges basically just allow anything at all. -tok('STAR') -src[t.STAR] = '(<|>)?=?\\s*\\*' +/***/ 80369: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) - } +var getMapData = __nccwpck_require__(71198); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); } -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +module.exports = mapCacheHas; - if (version instanceof SemVer) { - return version - } - if (typeof version !== 'string') { - return null - } +/***/ }), - if (version.length > MAX_LENGTH) { - return null - } +/***/ 66935: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null - } +var getMapData = __nccwpck_require__(71198); - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; } -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} +module.exports = mapCacheSet; -exports.SemVer = SemVer -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } +/***/ }), - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } +/***/ 46717: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (!(this instanceof SemVer)) { - return new SemVer(version, options) - } +var memoize = __nccwpck_require__(89058); - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); - if (!m) { - throw new TypeError('Invalid Version: ' + version) - } + var cache = result.cache; + return result; +} - this.raw = version +module.exports = memoizeCapped; - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } +/***/ }), - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } +/***/ 36786: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } +var getNative = __nccwpck_require__(76028); - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); - this.build = m[5] ? m[5].split('.') : [] - this.format() -} +module.exports = nativeCreate; -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') - } - return this.version -} -SemVer.prototype.toString = function () { - return this.version -} +/***/ }), -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +/***/ 11491: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return this.compareMain(other) || this.comparePre(other) -} +var overArg = __nccwpck_require__(90570); -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) -} +module.exports = nativeKeys; -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } +/***/ }), - var i = 0 - do { - var a = this.prerelease[i] - var b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) +/***/ 43101: +/***/ ((module) => { + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); } - } while (++i) + } + return result; } -SemVer.prototype.compareBuild = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +module.exports = nativeKeysIn; - var i = 0 - do { - var a = this.build[i] - var b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break +/***/ }), - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - var i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break +/***/ 62470: +/***/ ((module, exports, __nccwpck_require__) => { - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} +/* module decorator */ module = __nccwpck_require__.nmd(module); +var freeGlobal = __nccwpck_require__(37825); -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } -} + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } + if (types) { + return types; } - return defaultResult // may be undefined - } -} -exports.compareIdentifiers = compareIdentifiers + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) +module.exports = nodeUtil; - if (anum && bnum) { - a = +a - b = +b - } - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} +/***/ }), -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) -} +/***/ 49052: +/***/ ((module) => { -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major -} +/** Used for built-in method references. */ +var objectProto = Object.prototype; -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); } -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) +module.exports = objectToString; + + +/***/ }), + +/***/ 90570: +/***/ ((module) => { + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; } -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} +module.exports = overArg; -exports.compareBuild = compareBuild -function compareBuild (a, b, loose) { - var versionA = new SemVer(a, loose) - var versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) -} +/***/ }), -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(a, b, loose) - }) -} +/***/ 216: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(b, a, loose) - }) -} +var apply = __nccwpck_require__(99502); -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 -} +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; } -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} +module.exports = overRest; -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} +/***/ }), -exports.cmp = cmp -function cmp (a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b +/***/ 562: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b +var freeGlobal = __nccwpck_require__(37825); - case '': - case '=': - case '==': - return eq(a, b, loose) +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - case '!=': - return neq(a, b, loose) +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); - case '>': - return gt(a, b, loose) +module.exports = root; - case '>=': - return gte(a, b, loose) - case '<': - return lt(a, b, loose) +/***/ }), - case '<=': - return lte(a, b, loose) +/***/ 65444: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - default: - throw new TypeError('Invalid operator: ' + op) - } -} +var baseSetToString = __nccwpck_require__(3503), + shortOut = __nccwpck_require__(10697); -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } +module.exports = setToString; - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) - } - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) +/***/ }), - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } +/***/ 10697: +/***/ ((module) => { - debug('comp', this) -} +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var m = comp.match(r) +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; } -Comparator.prototype.toString = function () { - return this.value -} +module.exports = shortOut; -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) - if (this.semver === ANY || version === ANY) { - return true - } +/***/ }), - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } +/***/ 22614: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return cmp(version, this.operator, this.semver, this.options) +var ListCache = __nccwpck_require__(82746); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; } -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } +module.exports = stackClear; - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - var rangeTmp +/***/ }), - if (this.operator === '') { - if (this.value === '') { - return true - } - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) - } +/***/ 24202: +/***/ ((module) => { - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan + this.size = data.size; + return result; } -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +module.exports = stackDelete; - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) - } - } - if (range instanceof Comparator) { - return new Range(range.value, options) - } +/***/ }), - if (!(this instanceof Range)) { - return new Range(range, options) - } +/***/ 96310: +/***/ ((module) => { - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} - // First, split based on boolean or || - this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) +module.exports = stackGet; - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) - } - this.format() -} +/***/ }), -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range -} +/***/ 58721: +/***/ ((module) => { -Range.prototype.toString = function () { - return this.range +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); } -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) +module.exports = stackHas; - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) +/***/ }), - // normalize spaces - range = range.split(/\s+/).join(' ') +/***/ 90320: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // At this point, the range is completely trimmed and - // ready to be split into comparators. +var ListCache = __nccwpck_require__(82746), + Map = __nccwpck_require__(51105), + MapCache = __nccwpck_require__(16531); - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) - } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; - return set +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; } -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } +module.exports = stackSet; - return this.set.some(function (thisComparators) { - return ( - isSatisfiable(thisComparators, options) && - range.set.some(function (rangeComparators) { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every(function (thisComparator) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) -} -// take a set of comparators and determine whether there -// exists a version which can satisfy it -function isSatisfiable (comparators, options) { - var result = true - var remainingComparators = comparators.slice() - var testComparator = remainingComparators.pop() +/***/ }), - while (result && remainingComparators.length) { - result = remainingComparators.every(function (otherComparator) { - return testComparator.intersects(otherComparator, options) - }) +/***/ 35725: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var memoizeCapped = __nccwpck_require__(46717); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); - testComparator = remainingComparators.pop() - } +module.exports = stringToPath; - return result -} -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) -} +/***/ }), -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator (comp, options) { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} +/***/ 30668: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' -} +var isSymbol = __nccwpck_require__(82500); -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') -} +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; -function replaceTilde (comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } +module.exports = toKey; - debug('tilde return', ret) - return ret - }) -} -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') -} +/***/ }), -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret +/***/ 98241: +/***/ ((module) => { - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } - } +/** Used for built-in method references. */ +var funcProto = Function.prototype; - debug('caret return', ret) - return ret - }) -} +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; } -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp +module.exports = toSource; - if (gtlt === '=' && anyX) { - gtlt = '' - } - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' +/***/ }), - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 +/***/ 66690: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } +var assignValue = __nccwpck_require__(55647), + copyObject = __nccwpck_require__(83568), + createAssigner = __nccwpck_require__(21479), + isArrayLike = __nccwpck_require__(20577), + isPrototype = __nccwpck_require__(4954), + keys = __nccwpck_require__(50288); - ret = gtlt + M + '.' + m + '.' + p + pr - } else if (xm) { - ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr - } else if (xp) { - ret = '>=' + M + '.' + m + '.0' + pr + - ' <' + M + '.' + (+m + 1) + '.0' + pr - } +/** Used for built-in method references. */ +var objectProto = Object.prototype; - debug('xRange return', ret) +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - return ret - }) -} +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') -} +module.exports = assign; -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = '>=' + fM + '.0.0' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } +/***/ }), - return (from + ' ' + to).trim() -} +/***/ 31471: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } +var baseClone = __nccwpck_require__(95570); - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false +/** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ +function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); } -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } +module.exports = clone; - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } +/***/ }), - // Version has a -pre, but it's not one of the ones we like. - return false - } +/***/ 66915: +/***/ ((module) => { - return true +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; } -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} +module.exports = constant; -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min +/***/ }), + +/***/ 28650: +/***/ ((module) => { + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); } -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) - - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } +module.exports = eq; - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error('Unexpected operation: ' + comparator.operator) - } - }) - } +/***/ }), - if (minver && range.test(minver)) { - return minver - } +/***/ 8708: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return null -} +var baseFlatten = __nccwpck_require__(5765); -exports.validRange = validRange -function validRange (range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; } -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} +module.exports = flatten; -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) -} -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) +/***/ }), - var gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } +/***/ 14426: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } +var baseHasIn = __nccwpck_require__(56263), + hasPath = __nccwpck_require__(23144); - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] +module.exports = hasIn; - var high = null - var low = null - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) +/***/ }), - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } +/***/ 57460: +/***/ ((module) => { - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; } -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} +module.exports = identity; -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} -exports.coerce = coerce -function coerce (version, options) { - if (version instanceof SemVer) { - return version - } +/***/ }), - if (typeof version === 'number') { - version = String(version) - } +/***/ 24839: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (typeof version !== 'string') { - return null - } +var baseIsArguments = __nccwpck_require__(77907), + isObjectLike = __nccwpck_require__(9111); - options = options || {} +/** Used for built-in method references. */ +var objectProto = Object.prototype; - var match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - var next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - if (match === null) { - return null - } +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; - return parse(match[2] + - '.' + (match[3] || '0') + - '.' + (match[4] || '0'), options) -} +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; /***/ }), -/***/ 89437: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 43364: +/***/ ((module) => { -"use strict"; +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; -const escapeStringRegexp = __webpack_require__(77619); +module.exports = isArray; -const regexpCache = new Map(); -function makeRegexp(pattern, options) { - options = { - caseSensitive: false, - ...options - }; +/***/ }), - const cacheKey = pattern + JSON.stringify(options); +/***/ 20577: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (regexpCache.has(cacheKey)) { - return regexpCache.get(cacheKey); - } +var isFunction = __nccwpck_require__(66827), + isLength = __nccwpck_require__(55752); - const negated = pattern[0] === '!'; +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} - if (negated) { - pattern = pattern.slice(1); - } +module.exports = isArrayLike; - pattern = escapeStringRegexp(pattern).replace(/\\\*/g, '.*'); - const regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i'); - regexp.negated = negated; - regexpCache.set(cacheKey, regexp); +/***/ }), - return regexp; -} +/***/ 12963: +/***/ ((module, exports, __nccwpck_require__) => { -module.exports = (inputs, patterns, options) => { - if (!(Array.isArray(inputs) && Array.isArray(patterns))) { - throw new TypeError(`Expected two arrays, got ${typeof inputs} ${typeof patterns}`); - } +/* module decorator */ module = __nccwpck_require__.nmd(module); +var root = __nccwpck_require__(562), + stubFalse = __nccwpck_require__(90377); - if (patterns.length === 0) { - return inputs; - } +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; - const firstNegated = patterns[0][0] === '!'; +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - patterns = patterns.map(pattern => makeRegexp(pattern, options)); +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; - const result = []; +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; - for (const input of inputs) { - // If first pattern is negated we include everything to match user expectation - let matches = firstNegated; +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - for (const pattern of patterns) { - if (pattern.test(input)) { - matches = !pattern.negated; - } - } +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; - if (matches) { - result.push(input); - } - } +module.exports = isBuffer; - return result; -}; -module.exports.isMatch = (input, pattern, options) => { - const inputArray = Array.isArray(input) ? input : [input]; - const patternArray = Array.isArray(pattern) ? pattern : [pattern]; +/***/ }), - return inputArray.some(input => { - return patternArray.every(pattern => { - const regexp = makeRegexp(pattern, options); - const matches = regexp.test(input); - return regexp.negated ? !matches : matches; - }); - }); -}; +/***/ 66827: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var baseGetTag = __nccwpck_require__(98653), + isObject = __nccwpck_require__(43420); -/***/ }), +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; -/***/ 77619: -/***/ ((module) => { +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} -"use strict"; +module.exports = isFunction; -const matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g; +/***/ }), -module.exports = string => { - if (typeof string !== 'string') { - throw new TypeError('Expected a string'); - } +/***/ 55752: +/***/ ((module) => { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} - return string.replace(matchOperatorsRegex, '\\$&'); -}; +module.exports = isLength; /***/ }), -/***/ 6020: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 13689: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var baseIsMap = __nccwpck_require__(81391), + baseUnary = __nccwpck_require__(83717), + nodeUtil = __nccwpck_require__(62470); +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; -const { PassThrough } = __webpack_require__(92413); +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; -module.exports = function (/*streams...*/) { - var sources = [] - var output = new PassThrough({objectMode: true}) +module.exports = isMap; - output.setMaxListeners(0) - output.add = add - output.isEmpty = isEmpty +/***/ }), - output.on('unpipe', remove) +/***/ 43420: +/***/ ((module) => { - Array.prototype.slice.call(arguments).forEach(add) +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} - return output +module.exports = isObject; - function add (source) { - if (Array.isArray(source)) { - source.forEach(add) - return this - } - sources.push(source); - source.once('end', remove.bind(null, source)) - source.once('error', output.emit.bind(output, 'error')) - source.pipe(output, {end: false}) - return this - } +/***/ }), - function isEmpty () { - return sources.length == 0; - } +/***/ 9111: +/***/ ((module) => { - function remove (source) { - sources = sources.filter(function (it) { return it !== source }) - if (!sources.length && output.readable) { output.end() } - } +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; } +module.exports = isObjectLike; -/***/ }), -/***/ 71883: -/***/ ((module) => { +/***/ }), -"use strict"; +/***/ 81360: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var baseIsSet = __nccwpck_require__(19472), + baseUnary = __nccwpck_require__(83717), + nodeUtil = __nccwpck_require__(62470); -const mimicFn = (to, from) => { - for (const prop of Reflect.ownKeys(from)) { - Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); - } +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; - return to; -}; +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; -module.exports = mimicFn; -// TODO: Remove this for the next major release -module.exports.default = mimicFn; +module.exports = isSet; /***/ }), -/***/ 27480: -/***/ ((module) => { - -"use strict"; - +/***/ 82500: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// We define these manually to ensure they're always copied -// even if they would move up the prototype chain -// https://nodejs.org/api/http.html#http_class_http_incomingmessage -const knownProps = [ - 'destroy', - 'setTimeout', - 'socket', - 'headers', - 'trailers', - 'rawHeaders', - 'statusCode', - 'httpVersion', - 'httpVersionMinor', - 'httpVersionMajor', - 'rawTrailers', - 'statusMessage' -]; +var baseGetTag = __nccwpck_require__(98653), + isObjectLike = __nccwpck_require__(9111); -module.exports = (fromStream, toStream) => { - const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; - for (const prop of fromProps) { - // Don't overwrite existing properties - if (prop in toStream) { - continue; - } +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} - toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; - } -}; +module.exports = isSymbol; /***/ }), -/***/ 26944: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = __webpack_require__(85622) -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(85533) - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} +/***/ 53635: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' +var baseIsTypedArray = __nccwpck_require__(86944), + baseUnary = __nccwpck_require__(83717), + nodeUtil = __nccwpck_require__(62470); -// * => any number of characters -var star = qmark + '*?' +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' +module.exports = isTypedArray; -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} +/***/ }), -// normalizes slashes. -var slashSplit = /\/+/ +/***/ 50288: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} +var arrayLikeKeys = __nccwpck_require__(63360), + baseKeys = __nccwpck_require__(24787), + isArrayLike = __nccwpck_require__(20577); -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch +module.exports = keys; - var orig = minimatch - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } +/***/ }), - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } +/***/ 86032: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return m -} +var arrayLikeKeys = __nccwpck_require__(63360), + baseKeysIn = __nccwpck_require__(14535), + isArrayLike = __nccwpck_require__(20577); -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } +module.exports = keysIn; - if (!options) options = {} - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } +/***/ }), - // "" only matches "" - if (pattern.trim() === '') return p === '' +/***/ 89058: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return new Minimatch(pattern, options).match(p) -} +var MapCache = __nccwpck_require__(16531); -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false +// Expose `MapCache`. +memoize.Cache = MapCache; - // make the set of regexps etc. - this.make() -} +module.exports = memoize; -Minimatch.prototype.debug = function () {} -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return +/***/ }), - var pattern = this.pattern - var options = this.options +/***/ 53651: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } +var basePick = __nccwpck_require__(3529), + flatRest = __nccwpck_require__(34800); - // step 1: figure out negation, etc. - this.parseNegate() +/** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ +var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); +}); - // step 2: expand braces - var set = this.globSet = this.braceExpand() +module.exports = pick; - if (options.debug) this.debug = console.error - this.debug(this.pattern, set) +/***/ }), - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) +/***/ 87632: +/***/ ((module) => { - this.debug(this.pattern, set) +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) +module.exports = stubArray; - this.debug(this.pattern, set) - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) +/***/ }), - this.debug(this.pattern, set) +/***/ 90377: +/***/ ((module) => { - this.set = set +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; } -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 +module.exports = stubFalse; - if (options.nonegate) return - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } +/***/ }), - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} +/***/ 49228: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) +var baseToString = __nccwpck_require__(74851); + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); } -Minimatch.prototype.braceExpand = braceExpand +module.exports = toString; -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern +/***/ }), - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } +/***/ 87279: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } +"use strict"; - return expand(pattern) -} +const chalk = __nccwpck_require__(7833); -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } +const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; - var options = this.options +const main = { + info: chalk.blue('ℹ'), + success: chalk.green('✔'), + warning: chalk.yellow('⚠'), + error: chalk.red('✖') +}; - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' +const fallbacks = { + info: chalk.blue('i'), + success: chalk.green('√'), + warning: chalk.yellow('‼'), + error: chalk.red('×') +}; - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this +module.exports = isSupported ? main : fallbacks; - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) +/***/ }), - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } +/***/ 18984: +/***/ ((module) => { - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false +"use strict"; - case '\\': - clearStateChar() - escaping = true - continue +module.exports = function (obj) { + var ret = {}; + var keys = Object.keys(Object(obj)); - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + for (var i = 0; i < keys.length; i++) { + ret[keys[i].toLowerCase()] = obj[keys[i]]; + } - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } + return ret; +}; - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - case '(': - if (inClass) { - re += '(' - continue - } +/***/ }), - if (!stateChar) { - re += '\\(' - continue - } +/***/ 85069: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue +"use strict"; - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue +// A linked list to keep track of recently-used-ness +const Yallist = __nccwpck_require__(3652) - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } +const MAX = Symbol('max') +const LENGTH = Symbol('length') +const LENGTH_CALCULATOR = Symbol('lengthCalculator') +const ALLOW_STALE = Symbol('allowStale') +const MAX_AGE = Symbol('maxAge') +const DISPOSE = Symbol('dispose') +const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') +const LRU_LIST = Symbol('lruList') +const CACHE = Symbol('cache') +const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') - clearStateChar() - re += '|' - continue +const naiveLength = () => 1 - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() +// lruList is a yallist where the head is the youngest +// item, and the tail is the oldest. the list contains the Hit +// objects as the entries. +// Each Hit object has a reference to its Yallist.Node. This +// never changes. +// +// cache is a Map (or PseudoMap) that matches the keys to +// the Yallist.Node object. +class LRUCache { + constructor (options) { + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} - if (inClass) { - re += '\\' + c - continue - } + if (options.max && (typeof options.max !== 'number' || options.max < 0)) + throw new TypeError('max must be a non-negative number') + // Kind of weird to have a default max of Infinity, but oh well. + const max = this[MAX] = options.max || Infinity - inClass = true - classStart = i - reClassStart = re.length - re += c - continue + const lc = options.length || naiveLength + this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc + this[ALLOW_STALE] = options.stale || false + if (options.maxAge && typeof options.maxAge !== 'number') + throw new TypeError('maxAge must be a number') + this[MAX_AGE] = options.maxAge || 0 + this[DISPOSE] = options.dispose + this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false + this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false + this.reset() + } - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } + // resize the cache when the max changes. + set max (mL) { + if (typeof mL !== 'number' || mL < 0) + throw new TypeError('max must be a non-negative number') - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } + this[MAX] = mL || Infinity + trim(this) + } + get max () { + return this[MAX] + } - // finish up the class. - hasMagic = true - inClass = false - re += c - continue + set allowStale (allowStale) { + this[ALLOW_STALE] = !!allowStale + } + get allowStale () { + return this[ALLOW_STALE] + } - default: - // swallow any state char that wasn't consumed - clearStateChar() + set maxAge (mA) { + if (typeof mA !== 'number') + throw new TypeError('maxAge must be a non-negative number') - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } + this[MAX_AGE] = mA + trim(this) + } + get maxAge () { + return this[MAX_AGE] + } - re += c + // resize the cache when the lengthCalculator changes. + set lengthCalculator (lC) { + if (typeof lC !== 'function') + lC = naiveLength - } // switch - } // for + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC + this[LENGTH] = 0 + this[LRU_LIST].forEach(hit => { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) + this[LENGTH] += hit.length + }) + } + trim(this) + } + get lengthCalculator () { return this[LENGTH_CALCULATOR] } - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] + get length () { return this[LENGTH] } + get itemCount () { return this[LRU_LIST].length } + + rforEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].tail; walker !== null;) { + const prev = walker.prev + forEachStep(this, fn, walker, thisp) + walker = prev + } } - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } + forEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].head; walker !== null;) { + const next = walker.next + forEachStep(this, fn, walker, thisp) + walker = next + } + } - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) + keys () { + return this[LRU_LIST].toArray().map(k => k.key) + } - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type + values () { + return this[LRU_LIST].toArray().map(k => k.value) + } - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail + reset () { + if (this[DISPOSE] && + this[LRU_LIST] && + this[LRU_LIST].length) { + this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) + } + + this[CACHE] = new Map() // hash of items by key + this[LRU_LIST] = new Yallist() // list of items in order of use recency + this[LENGTH] = 0 // length of items in the list } - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' + dump () { + return this[LRU_LIST].map(hit => + isStale(this, hit) ? false : { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }).toArray().filter(h => h) } - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true + dumpLru () { + return this[LRU_LIST] } - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] + set (key, value, maxAge) { + maxAge = maxAge || this[MAX_AGE] - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) + if (maxAge && typeof maxAge !== 'number') + throw new TypeError('maxAge must be a number') - nlLast += nlAfter + const now = maxAge ? Date.now() : 0 + const len = this[LENGTH_CALCULATOR](value, key) - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + if (this[CACHE].has(key)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key)) + return false + } + + const node = this[CACHE].get(key) + const item = node.value + + // dispose of the old one before overwriting + // split out into 2 ifs for better coverage tracking + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) + this[DISPOSE](key, item.value) + } + + item.now = now + item.maxAge = maxAge + item.value = value + this[LENGTH] += len - item.length + item.length = len + this.get(key) + trim(this) + return true } - nlAfter = cleanAfter - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' + const hit = new Entry(key, value, len, now, maxAge) + + // oversized objects fall out of cache automatically. + if (hit.length > this[MAX]) { + if (this[DISPOSE]) + this[DISPOSE](key, value) + + return false } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re + this[LENGTH] += hit.length + this[LRU_LIST].unshift(hit) + this[CACHE].set(key, this[LRU_LIST].head) + trim(this) + return true } - if (addPatternStart) { - re = patternStart + re + has (key) { + if (!this[CACHE].has(key)) return false + const hit = this[CACHE].get(key).value + return !isStale(this, hit) } - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] + get (key) { + return get(this, key, true) } - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) + peek (key) { + return get(this, key, false) } - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') + pop () { + const node = this[LRU_LIST].tail + if (!node) + return null + + del(this, node) + return node.value } - regExp._glob = pattern - regExp._src = re + del (key) { + del(this, this[CACHE].get(key)) + } - return regExp + load (arr) { + // reset the cache + this.reset() + + const now = Date.now() + // A previous serialized cache has the most recent items first + for (let l = arr.length - 1; l >= 0; l--) { + const hit = arr[l] + const expiresAt = hit.e || 0 + if (expiresAt === 0) + // the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + else { + const maxAge = expiresAt - now + // dont add already expired items + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge) + } + } + } + } + + prune () { + this[CACHE].forEach((value, key) => get(this, key, false)) + } } -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() +const get = (self, key, doUse) => { + const node = self[CACHE].get(key) + if (node) { + const hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + return undefined + } else { + if (doUse) { + if (self[UPDATE_AGE_ON_GET]) + node.value.now = Date.now() + self[LRU_LIST].unshiftNode(node) + } + } + return hit.value + } } -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp +const isStale = (self, hit) => { + if (!hit || (!hit.maxAge && !self[MAX_AGE])) + return false - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set + const diff = Date.now() - hit.now + return hit.maxAge ? diff > hit.maxAge + : self[MAX_AGE] && (diff > self[MAX_AGE]) +} - if (!set.length) { - this.regexp = false - return this.regexp +const trim = self => { + if (self[LENGTH] > self[MAX]) { + for (let walker = self[LRU_LIST].tail; + self[LENGTH] > self[MAX] && walker !== null;) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + const prev = walker.prev + del(self, walker) + walker = prev + } } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') +} - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' +const del = (self, node) => { + if (node) { + const hit = node.value + if (self[DISPOSE]) + self[DISPOSE](hit.key, hit.value) - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' + self[LENGTH] -= hit.length + self[CACHE].delete(hit.key) + self[LRU_LIST].removeNode(node) + } +} - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false +class Entry { + constructor (key, value, length, now, maxAge) { + this.key = key + this.value = value + this.length = length + this.now = now + this.maxAge = maxAge || 0 } - return this.regexp } -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) +const forEachStep = (self, fn, node, thisp) => { + let hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + hit = undefined } - return list + if (hit) + fn.call(thisp, hit.value, hit.key, self) } -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' +module.exports = LRUCache - if (f === '/' && partial) return true - var options = this.options +/***/ }), - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } +/***/ 89437: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) +"use strict"; - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. +const escapeStringRegexp = __nccwpck_require__(77619); - var set = this.set - this.debug(this.pattern, 'set', set) +const regexpCache = new Map(); - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } +function makeRegexp(pattern, options) { + options = { + caseSensitive: false, + ...options + }; - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } + const cacheKey = pattern + JSON.stringify(options); - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate + if (regexpCache.has(cacheKey)) { + return regexpCache.get(cacheKey); + } + + const negated = pattern[0] === '!'; + + if (negated) { + pattern = pattern.slice(1); + } + + pattern = escapeStringRegexp(pattern).replace(/\\\*/g, '[\\s\\S]*'); + + const regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i'); + regexp.negated = negated; + regexpCache.set(cacheKey, regexp); + + return regexp; } -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options +module.exports = (inputs, patterns, options) => { + if (!(Array.isArray(inputs) && Array.isArray(patterns))) { + throw new TypeError(`Expected two arrays, got ${typeof inputs} ${typeof patterns}`); + } - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) + if (patterns.length === 0) { + return inputs; + } - this.debug('matchOne', file.length, pattern.length) + const isFirstPatternNegated = patterns[0][0] === '!'; - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] + patterns = patterns.map(pattern => makeRegexp(pattern, options)); - this.debug(pattern, p, f) + const result = []; - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false + for (const input of inputs) { + // If first pattern is negated we include everything to match user expectation. + let matches = isFirstPatternNegated; - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) + for (const pattern of patterns) { + if (pattern.test(input)) { + matches = !pattern.negated; + } + } - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } + if (matches) { + result.push(input); + } + } - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] + return result; +}; - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) +module.exports.isMatch = (input, pattern, options) => { + const inputArray = Array.isArray(input) ? input : [input]; + const patternArray = Array.isArray(pattern) ? pattern : [pattern]; - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } + return inputArray.some(input => { + return patternArray.every(pattern => { + const regexp = makeRegexp(pattern, options); + const matches = regexp.test(input); + return regexp.negated ? !matches : matches; + }); + }); +}; - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } +/***/ }), - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) +/***/ 77619: +/***/ ((module) => { + +"use strict"; + + +module.exports = string => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } + + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +}; + + +/***/ }), + +/***/ 6020: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { PassThrough } = __nccwpck_require__(92413); + +module.exports = function (/*streams...*/) { + var sources = [] + var output = new PassThrough({objectMode: true}) + + output.setMaxListeners(0) + + output.add = add + output.isEmpty = isEmpty + + output.on('unpipe', remove) + + Array.prototype.slice.call(arguments).forEach(add) + + return output + + function add (source) { + if (Array.isArray(source)) { + source.forEach(add) + return this } - if (!hit) return false + sources.push(source); + source.once('end', remove.bind(null, source)) + source.once('error', output.emit.bind(output, 'error')) + source.pipe(output, {end: false}) + return this } - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd + function isEmpty () { + return sources.length == 0; } - // should be unreachable. - throw new Error('wtf?') + function remove (source) { + sources = sources.filter(function (it) { return it !== source }) + if (!sources.length && output.readable) { output.end() } + } } -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} +/***/ }), + +/***/ 71883: +/***/ ((module) => { + +"use strict"; + + +const mimicFn = (to, from) => { + for (const prop of Reflect.ownKeys(from)) { + Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); + } + + return to; +}; + +module.exports = mimicFn; +// TODO: Remove this for the next major release +module.exports.default = mimicFn; + + +/***/ }), + +/***/ 27480: +/***/ ((module) => { + +"use strict"; + + +// We define these manually to ensure they're always copied +// even if they would move up the prototype chain +// https://nodejs.org/api/http.html#http_class_http_incomingmessage +const knownProps = [ + 'destroy', + 'setTimeout', + 'socket', + 'headers', + 'trailers', + 'rawHeaders', + 'statusCode', + 'httpVersion', + 'httpVersionMinor', + 'httpVersionMajor', + 'rawTrailers', + 'statusMessage' +]; + +module.exports = (fromStream, toStream) => { + const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); + + for (const prop of fromProps) { + // Don't overwrite existing properties + if (prop in toStream) { + continue; + } + + toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; + } +}; /***/ }), @@ -78469,158 +64648,6 @@ function plural(ms, msAbs, n, name) { } -/***/ }), - -/***/ 64003: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var Stream = __webpack_require__(92413) - -module.exports = MuteStream - -// var out = new MuteStream(process.stdout) -// argument auto-pipes -function MuteStream (opts) { - Stream.apply(this) - opts = opts || {} - this.writable = this.readable = true - this.muted = false - this.on('pipe', this._onpipe) - this.replace = opts.replace - - // For readline-type situations - // This much at the start of a line being redrawn after a ctrl char - // is seen (such as backspace) won't be redrawn as the replacement - this._prompt = opts.prompt || null - this._hadControl = false -} - -MuteStream.prototype = Object.create(Stream.prototype) - -Object.defineProperty(MuteStream.prototype, 'constructor', { - value: MuteStream, - enumerable: false -}) - -MuteStream.prototype.mute = function () { - this.muted = true -} - -MuteStream.prototype.unmute = function () { - this.muted = false -} - -Object.defineProperty(MuteStream.prototype, '_onpipe', { - value: onPipe, - enumerable: false, - writable: true, - configurable: true -}) - -function onPipe (src) { - this._src = src -} - -Object.defineProperty(MuteStream.prototype, 'isTTY', { - get: getIsTTY, - set: setIsTTY, - enumerable: true, - configurable: true -}) - -function getIsTTY () { - return( (this._dest) ? this._dest.isTTY - : (this._src) ? this._src.isTTY - : false - ) -} - -// basically just get replace the getter/setter with a regular value -function setIsTTY (isTTY) { - Object.defineProperty(this, 'isTTY', { - value: isTTY, - enumerable: true, - writable: true, - configurable: true - }) -} - -Object.defineProperty(MuteStream.prototype, 'rows', { - get: function () { - return( this._dest ? this._dest.rows - : this._src ? this._src.rows - : undefined ) - }, enumerable: true, configurable: true }) - -Object.defineProperty(MuteStream.prototype, 'columns', { - get: function () { - return( this._dest ? this._dest.columns - : this._src ? this._src.columns - : undefined ) - }, enumerable: true, configurable: true }) - - -MuteStream.prototype.pipe = function (dest, options) { - this._dest = dest - return Stream.prototype.pipe.call(this, dest, options) -} - -MuteStream.prototype.pause = function () { - if (this._src) return this._src.pause() -} - -MuteStream.prototype.resume = function () { - if (this._src) return this._src.resume() -} - -MuteStream.prototype.write = function (c) { - if (this.muted) { - if (!this.replace) return true - if (c.match(/^\u001b/)) { - if(c.indexOf(this._prompt) === 0) { - c = c.substr(this._prompt.length); - c = c.replace(/./g, this.replace); - c = this._prompt + c; - } - this._hadControl = true - return this.emit('data', c) - } else { - if (this._prompt && this._hadControl && - c.indexOf(this._prompt) === 0) { - this._hadControl = false - this.emit('data', this._prompt) - c = c.substr(this._prompt.length) - } - c = c.toString().replace(/./g, this.replace) - } - } - this.emit('data', c) -} - -MuteStream.prototype.end = function (c) { - if (this.muted) { - if (c && this.replace) { - c = c.toString().replace(/./g, this.replace) - } else { - c = null - } - } - if (c) this.emit('data', c) - this.emit('end') -} - -function proxy (fn) { return function () { - var d = this._dest - var s = this._src - if (d && d[fn]) d[fn].apply(d, arguments) - if (s && s[fn]) s[fn].apply(s, arguments) -}} - -MuteStream.prototype.destroy = proxy('destroy') -MuteStream.prototype.destroySoon = proxy('destroySoon') -MuteStream.prototype.close = proxy('close') - - /***/ }), /***/ 76254: @@ -78645,16 +64672,16 @@ function extractDescription (d) { /***/ }), /***/ 94704: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var semver = __webpack_require__(9546) -var validateLicense = __webpack_require__(52078); -var hostedGitInfo = __webpack_require__(47052) -var isBuiltinModule = __webpack_require__(72305).isCore +var semver = __nccwpck_require__(9546) +var validateLicense = __nccwpck_require__(52078); +var hostedGitInfo = __nccwpck_require__(47052) +var isBuiltinModule = __nccwpck_require__(72305).isCore var depTypes = ["dependencies","devDependencies","optionalDependencies"] -var extractDescription = __webpack_require__(76254) -var url = __webpack_require__(78835) -var typos = __webpack_require__(30488) +var extractDescription = __nccwpck_require__(76254) +var url = __nccwpck_require__(78835) +var typos = __nccwpck_require__(30488) var fixer = module.exports = { // default warning function @@ -79070,10 +65097,10 @@ function bugsTypos(bugs, warn) { /***/ }), /***/ 21652: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var util = __webpack_require__(31669) -var messages = __webpack_require__(51510) +var util = __nccwpck_require__(31669) +var messages = __nccwpck_require__(51510) module.exports = function() { var args = Array.prototype.slice.call(arguments, 0) @@ -79100,14 +65127,14 @@ function makeTypoWarning (providedName, probableName, field) { /***/ }), /***/ 44586: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = normalize -var fixer = __webpack_require__(94704) +var fixer = __nccwpck_require__(94704) normalize.fixer = fixer -var makeWarning = __webpack_require__(21652) +var makeWarning = __nccwpck_require__(21652) var fieldsToFix = ['name','version','description','repository','modules','scripts' ,'files','bin','man','bugs','keywords','readme','homepage','license'] @@ -80636,12 +66663,12 @@ function coerce (version) { /***/ }), /***/ 68938: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // TODO: Use the `URL` global when targeting Node.js 10 -const URLParser = typeof URL === 'undefined' ? __webpack_require__(78835).URL : URL; +const URLParser = typeof URL === 'undefined' ? __nccwpck_require__(78835).URL : URL; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain'; @@ -80651,5957 +66678,6612 @@ const testParameter = (name, filters) => { return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name); }; -const normalizeDataURL = (urlString, {stripHash}) => { - const parts = urlString.match(/^data:(.*?),(.*?)(?:#(.*))?$/); +const normalizeDataURL = (urlString, {stripHash}) => { + const parts = urlString.match(/^data:(.*?),(.*?)(?:#(.*))?$/); + + if (!parts) { + throw new Error(`Invalid URL: ${urlString}`); + } + + const mediaType = parts[1].split(';'); + const body = parts[2]; + const hash = stripHash ? '' : parts[3]; + + let base64 = false; + + if (mediaType[mediaType.length - 1] === 'base64') { + mediaType.pop(); + base64 = true; + } + + // Lowercase MIME type + const mimeType = (mediaType.shift() || '').toLowerCase(); + const attributes = mediaType + .map(attribute => { + let [key, value = ''] = attribute.split('=').map(string => string.trim()); + + // Lowercase `charset` + if (key === 'charset') { + value = value.toLowerCase(); + + if (value === DATA_URL_DEFAULT_CHARSET) { + return ''; + } + } + + return `${key}${value ? `=${value}` : ''}`; + }) + .filter(Boolean); + + const normalizedMediaType = [ + ...attributes + ]; + + if (base64) { + normalizedMediaType.push('base64'); + } + + if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) { + normalizedMediaType.unshift(mimeType); + } + + return `data:${normalizedMediaType.join(';')},${base64 ? body.trim() : body}${hash ? `#${hash}` : ''}`; +}; + +const normalizeUrl = (urlString, options) => { + options = { + defaultProtocol: 'http:', + normalizeProtocol: true, + forceHttp: false, + forceHttps: false, + stripAuthentication: true, + stripHash: false, + stripWWW: true, + removeQueryParameters: [/^utm_\w+/i], + removeTrailingSlash: true, + removeDirectoryIndex: false, + sortQueryParameters: true, + ...options + }; + + // TODO: Remove this at some point in the future + if (Reflect.has(options, 'normalizeHttps')) { + throw new Error('options.normalizeHttps is renamed to options.forceHttp'); + } + + if (Reflect.has(options, 'normalizeHttp')) { + throw new Error('options.normalizeHttp is renamed to options.forceHttps'); + } + + if (Reflect.has(options, 'stripFragment')) { + throw new Error('options.stripFragment is renamed to options.stripHash'); + } + + urlString = urlString.trim(); + + // Data URL + if (/^data:/i.test(urlString)) { + return normalizeDataURL(urlString, options); + } + + const hasRelativeProtocol = urlString.startsWith('//'); + const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString); + + // Prepend protocol + if (!isRelativeUrl) { + urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol); + } + + const urlObj = new URLParser(urlString); + + if (options.forceHttp && options.forceHttps) { + throw new Error('The `forceHttp` and `forceHttps` options cannot be used together'); + } + + if (options.forceHttp && urlObj.protocol === 'https:') { + urlObj.protocol = 'http:'; + } + + if (options.forceHttps && urlObj.protocol === 'http:') { + urlObj.protocol = 'https:'; + } + + // Remove auth + if (options.stripAuthentication) { + urlObj.username = ''; + urlObj.password = ''; + } + + // Remove hash + if (options.stripHash) { + urlObj.hash = ''; + } + + // Remove duplicate slashes if not preceded by a protocol + if (urlObj.pathname) { + // TODO: Use the following instead when targeting Node.js 10 + // `urlObj.pathname = urlObj.pathname.replace(/(? { + if (/^(?!\/)/g.test(p1)) { + return `${p1}/`; + } + + return '/'; + }); + } + + // Decode URI octets + if (urlObj.pathname) { + urlObj.pathname = decodeURI(urlObj.pathname); + } + + // Remove directory index + if (options.removeDirectoryIndex === true) { + options.removeDirectoryIndex = [/^index\.[a-z]+$/]; + } + + if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) { + let pathComponents = urlObj.pathname.split('/'); + const lastComponent = pathComponents[pathComponents.length - 1]; + + if (testParameter(lastComponent, options.removeDirectoryIndex)) { + pathComponents = pathComponents.slice(0, pathComponents.length - 1); + urlObj.pathname = pathComponents.slice(1).join('/') + '/'; + } + } + + if (urlObj.hostname) { + // Remove trailing dot + urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); + + // Remove `www.` + if (options.stripWWW && /^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(urlObj.hostname)) { + // Each label should be max 63 at length (min: 2). + // The extension should be max 5 at length (min: 2). + // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names + urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); + } + } + + // Remove query unwanted parameters + if (Array.isArray(options.removeQueryParameters)) { + for (const key of [...urlObj.searchParams.keys()]) { + if (testParameter(key, options.removeQueryParameters)) { + urlObj.searchParams.delete(key); + } + } + } + + // Sort query parameters + if (options.sortQueryParameters) { + urlObj.searchParams.sort(); + } + + if (options.removeTrailingSlash) { + urlObj.pathname = urlObj.pathname.replace(/\/$/, ''); + } + + // Take advantage of many of the Node `url` normalizations + urlString = urlObj.toString(); + + // Remove ending `/` + if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '') { + urlString = urlString.replace(/\/$/, ''); + } + + // Restore relative protocol, if applicable + if (hasRelativeProtocol && !options.normalizeProtocol) { + urlString = urlString.replace(/^http:\/\//, '//'); + } + + // Remove http/https + if (options.stripProtocol) { + urlString = urlString.replace(/^(?:https?:)?\/\//, ''); + } + + return urlString; +}; + +module.exports = normalizeUrl; +// TODO: Remove this for the next major release +module.exports.default = normalizeUrl; + + +/***/ }), + +/***/ 8569: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const path = __nccwpck_require__(85622); +const Conf = __nccwpck_require__(12430); +const defaults = __nccwpck_require__(5473); + +// https://github.com/npm/npm/blob/latest/lib/config/core.js#L101-L200 +module.exports = opts => { + const conf = new Conf(Object.assign({}, defaults.defaults)); + + conf.add(Object.assign({}, opts), 'cli'); + conf.addEnv(); + conf.loadPrefix(); + + const projectConf = path.resolve(conf.localPrefix, '.npmrc'); + const userConf = conf.get('userconfig'); + + if (!conf.get('global') && projectConf !== userConf) { + conf.addFile(projectConf, 'project'); + } else { + conf.add({}, 'project'); + } + + conf.addFile(conf.get('userconfig'), 'user'); + + if (conf.get('prefix')) { + const etc = path.resolve(conf.get('prefix'), 'etc'); + conf.root.globalconfig = path.resolve(etc, 'npmrc'); + conf.root.globalignorefile = path.resolve(etc, 'npmignore'); + } + + conf.addFile(conf.get('globalconfig'), 'global'); + conf.loadUser(); + + const caFile = conf.get('cafile'); + + if (caFile) { + conf.loadCAFile(caFile); + } + + return conf; +}; + +module.exports.defaults = Object.assign({}, defaults.defaults); + + +/***/ }), + +/***/ 12430: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const ConfigChain = __nccwpck_require__(18271).ConfigChain; +const util = __nccwpck_require__(95950); + +class Conf extends ConfigChain { + // https://github.com/npm/npm/blob/latest/lib/config/core.js#L208-L222 + constructor(base) { + super(base); + this.root = base; + } + + // https://github.com/npm/npm/blob/latest/lib/config/core.js#L332-L342 + add(data, marker) { + try { + for (const x of Object.keys(data)) { + data[x] = util.parseField(data[x], x); + } + } catch (err) { + throw err; + } + + return super.add(data, marker); + } + + // https://github.com/npm/npm/blob/latest/lib/config/core.js#L312-L325 + addFile(file, name) { + name = name || file; + + const marker = {__source__: name}; + + this.sources[name] = {path: file, type: 'ini'}; + this.push(marker); + this._await(); + + try { + const contents = fs.readFileSync(file, 'utf8'); + this.addString(contents, file, 'ini', marker); + } catch (err) { + this.add({}, marker); + } + + return this; + } + + // https://github.com/npm/npm/blob/latest/lib/config/core.js#L344-L360 + addEnv(env) { + env = env || process.env; + + const conf = {}; + + Object.keys(env) + .filter(x => /^npm_config_/i.test(x)) + .forEach(x => { + if (!env[x]) { + return; + } + + const p = x.toLowerCase() + .replace(/^npm_config_/, '') + .replace(/(?!^)_/g, '-'); + + conf[p] = env[x]; + }); + + return super.addEnv('', conf, 'env'); + } + + // https://github.com/npm/npm/blob/latest/lib/config/load-prefix.js + loadPrefix() { + const cli = this.list[0]; + + Object.defineProperty(this, 'prefix', { + enumerable: true, + set: prefix => { + const g = this.get('global'); + this[g ? 'globalPrefix' : 'localPrefix'] = prefix; + }, + get: () => { + const g = this.get('global'); + return g ? this.globalPrefix : this.localPrefix; + } + }); + + Object.defineProperty(this, 'globalPrefix', { + enumerable: true, + set: prefix => { + this.set('prefix', prefix); + }, + get: () => { + return path.resolve(this.get('prefix')); + } + }); + + let p; + + Object.defineProperty(this, 'localPrefix', { + enumerable: true, + set: prefix => { + p = prefix; + }, + get: () => { + return p; + } + }); + + if (Object.prototype.hasOwnProperty.call(cli, 'prefix')) { + p = path.resolve(cli.prefix); + } else { + try { + const prefix = util.findPrefix(process.cwd()); + p = prefix; + } catch (err) { + throw err; + } + } + + return p; + } + + // https://github.com/npm/npm/blob/latest/lib/config/load-cafile.js + loadCAFile(file) { + if (!file) { + return; + } + + try { + const contents = fs.readFileSync(file, 'utf8'); + const delim = '-----END CERTIFICATE-----'; + const output = contents + .split(delim) + .filter(x => Boolean(x.trim())) + .map(x => x.trimLeft() + delim); + + this.set('ca', output); + } catch (err) { + if (err.code === 'ENOENT') { + return; + } + + throw err; + } + } + + // https://github.com/npm/npm/blob/latest/lib/config/set-user.js + loadUser() { + const defConf = this.root; + + if (this.get('global')) { + return; + } + + if (process.env.SUDO_UID) { + defConf.user = Number(process.env.SUDO_UID); + return; + } + + const prefix = path.resolve(this.get('prefix')); + + try { + const stats = fs.statSync(prefix); + defConf.user = stats.uid; + } catch (err) { + if (err.code === 'ENOENT') { + return; + } + + throw err; + } + } +} + +module.exports = Conf; + + +/***/ }), + +/***/ 5473: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + // Generated with `lib/make.js` + + const os = __nccwpck_require__(12087); + const path = __nccwpck_require__(85622); + + const temp = os.tmpdir(); + const uidOrPid = process.getuid ? process.getuid() : process.pid; + const hasUnicode = () => true; + const isWindows = process.platform === 'win32'; + + const osenv = { + editor: () => process.env.EDITOR || process.env.VISUAL || (isWindows ? 'notepad.exe' : 'vi'), + shell: () => isWindows ? (process.env.COMSPEC || 'cmd.exe') : (process.env.SHELL || '/bin/bash') + }; + + const umask = { + fromString: () => process.umask() + }; + + let home = os.homedir(); - if (!parts) { - throw new Error(`Invalid URL: ${urlString}`); + if (home) { + process.env.HOME = home; + } else { + home = path.resolve(temp, 'npm-' + uidOrPid); } - const mediaType = parts[1].split(';'); - const body = parts[2]; - const hash = stripHash ? '' : parts[3]; + const cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm'; + const cacheRoot = process.platform === 'win32' ? process.env.APPDATA : home; + const cache = path.resolve(cacheRoot, cacheExtra); - let base64 = false; + let defaults; + let globalPrefix; - if (mediaType[mediaType.length - 1] === 'base64') { - mediaType.pop(); - base64 = true; - } + Object.defineProperty(exports, "defaults", ({ + get: function () { + if (defaults) return defaults; - // Lowercase MIME type - const mimeType = (mediaType.shift() || '').toLowerCase(); - const attributes = mediaType - .map(attribute => { - let [key, value = ''] = attribute.split('=').map(string => string.trim()); + if (process.env.PREFIX) { + globalPrefix = process.env.PREFIX; + } else if (process.platform === 'win32') { + // c:\node\node.exe --> prefix=c:\node\ + globalPrefix = path.dirname(process.execPath); + } else { + // /usr/local/bin/node --> prefix=/usr/local + globalPrefix = path.dirname(path.dirname(process.execPath)); // destdir only is respected on Unix - // Lowercase `charset` - if (key === 'charset') { - value = value.toLowerCase(); + if (process.env.DESTDIR) { + globalPrefix = path.join(process.env.DESTDIR, globalPrefix); + } + } - if (value === DATA_URL_DEFAULT_CHARSET) { - return ''; - } - } + defaults = { + access: null, + 'allow-same-version': false, + 'always-auth': false, + also: null, + 'auth-type': 'legacy', + 'bin-links': true, + browser: null, + ca: null, + cafile: null, + cache: cache, + 'cache-lock-stale': 60000, + 'cache-lock-retries': 10, + 'cache-lock-wait': 10000, + 'cache-max': Infinity, + 'cache-min': 10, + cert: null, + color: true, + depth: Infinity, + description: true, + dev: false, + 'dry-run': false, + editor: osenv.editor(), + 'engine-strict': false, + force: false, + 'fetch-retries': 2, + 'fetch-retry-factor': 10, + 'fetch-retry-mintimeout': 10000, + 'fetch-retry-maxtimeout': 60000, + git: 'git', + 'git-tag-version': true, + global: false, + globalconfig: path.resolve(globalPrefix, 'etc', 'npmrc'), + 'global-style': false, + group: process.platform === 'win32' ? 0 : process.env.SUDO_GID || process.getgid && process.getgid(), + 'ham-it-up': false, + heading: 'npm', + 'if-present': false, + 'ignore-prepublish': false, + 'ignore-scripts': false, + 'init-module': path.resolve(home, '.npm-init.js'), + 'init-author-name': '', + 'init-author-email': '', + 'init-author-url': '', + 'init-version': '1.0.0', + 'init-license': 'ISC', + json: false, + key: null, + 'legacy-bundling': false, + link: false, + 'local-address': undefined, + loglevel: 'notice', + logstream: process.stderr, + 'logs-max': 10, + long: false, + maxsockets: 50, + message: '%s', + 'metrics-registry': null, + 'node-version': process.version, + 'offline': false, + 'onload-script': false, + only: null, + optional: true, + 'package-lock': true, + parseable: false, + 'prefer-offline': false, + 'prefer-online': false, + prefix: globalPrefix, + production: process.env.NODE_ENV === 'production', + 'progress': !process.env.TRAVIS && !process.env.CI, + 'proprietary-attribs': true, + proxy: null, + 'https-proxy': null, + 'user-agent': 'npm/{npm-version} ' + 'node/{node-version} ' + '{platform} ' + '{arch}', + 'rebuild-bundle': true, + registry: 'https://registry.npmjs.org/', + rollback: true, + save: true, + 'save-bundle': false, + 'save-dev': false, + 'save-exact': false, + 'save-optional': false, + 'save-prefix': '^', + 'save-prod': false, + scope: '', + 'script-shell': null, + 'scripts-prepend-node-path': 'warn-only', + searchopts: '', + searchexclude: null, + searchlimit: 20, + searchstaleness: 15 * 60, + 'send-metrics': false, + shell: osenv.shell(), + shrinkwrap: true, + 'sign-git-tag': false, + 'sso-poll-frequency': 500, + 'sso-type': 'oauth', + 'strict-ssl': true, + tag: 'latest', + 'tag-version-prefix': 'v', + timing: false, + tmp: temp, + unicode: hasUnicode(), + 'unsafe-perm': process.platform === 'win32' || process.platform === 'cygwin' || !(process.getuid && process.setuid && process.getgid && process.setgid) || process.getuid() !== 0, + usage: false, + user: process.platform === 'win32' ? 0 : 'nobody', + userconfig: path.resolve(home, '.npmrc'), + umask: process.umask ? process.umask() : umask.fromString('022'), + version: false, + versions: false, + viewer: process.platform === 'win32' ? 'browser' : 'man', + _exit: true + }; + return defaults; + } +})) - return `${key}${value ? `=${value}` : ''}`; - }) - .filter(Boolean); - const normalizedMediaType = [ - ...attributes - ]; +/***/ }), - if (base64) { - normalizedMediaType.push('base64'); - } +/***/ 18406: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) { - normalizedMediaType.unshift(mimeType); - } +"use strict"; - return `data:${normalizedMediaType.join(';')},${base64 ? body.trim() : body}${hash ? `#${hash}` : ''}`; -}; + // Generated with `lib/make.js` + + const path = __nccwpck_require__(85622); + const Stream = __nccwpck_require__(92413).Stream; + const url = __nccwpck_require__(78835); -const normalizeUrl = (urlString, options) => { - options = { - defaultProtocol: 'http:', - normalizeProtocol: true, - forceHttp: false, - forceHttps: false, - stripAuthentication: true, - stripHash: false, - stripWWW: true, - removeQueryParameters: [/^utm_\w+/i], - removeTrailingSlash: true, - removeDirectoryIndex: false, - sortQueryParameters: true, - ...options - }; + const Umask = () => {}; + const getLocalAddresses = () => []; + const semver = () => {}; - // TODO: Remove this at some point in the future - if (Reflect.has(options, 'normalizeHttps')) { - throw new Error('options.normalizeHttps is renamed to options.forceHttp'); - } + exports.types = { + access: [null, 'restricted', 'public'], + 'allow-same-version': Boolean, + 'always-auth': Boolean, + also: [null, 'dev', 'development'], + 'auth-type': ['legacy', 'sso', 'saml', 'oauth'], + 'bin-links': Boolean, + browser: [null, String], + ca: [null, String, Array], + cafile: path, + cache: path, + 'cache-lock-stale': Number, + 'cache-lock-retries': Number, + 'cache-lock-wait': Number, + 'cache-max': Number, + 'cache-min': Number, + cert: [null, String], + color: ['always', Boolean], + depth: Number, + description: Boolean, + dev: Boolean, + 'dry-run': Boolean, + editor: String, + 'engine-strict': Boolean, + force: Boolean, + 'fetch-retries': Number, + 'fetch-retry-factor': Number, + 'fetch-retry-mintimeout': Number, + 'fetch-retry-maxtimeout': Number, + git: String, + 'git-tag-version': Boolean, + global: Boolean, + globalconfig: path, + 'global-style': Boolean, + group: [Number, String], + 'https-proxy': [null, url], + 'user-agent': String, + 'ham-it-up': Boolean, + 'heading': String, + 'if-present': Boolean, + 'ignore-prepublish': Boolean, + 'ignore-scripts': Boolean, + 'init-module': path, + 'init-author-name': String, + 'init-author-email': String, + 'init-author-url': ['', url], + 'init-license': String, + 'init-version': semver, + json: Boolean, + key: [null, String], + 'legacy-bundling': Boolean, + link: Boolean, + // local-address must be listed as an IP for a local network interface + // must be IPv4 due to node bug + 'local-address': getLocalAddresses(), + loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'], + logstream: Stream, + 'logs-max': Number, + long: Boolean, + maxsockets: Number, + message: String, + 'metrics-registry': [null, String], + 'node-version': [null, semver], + offline: Boolean, + 'onload-script': [null, String], + only: [null, 'dev', 'development', 'prod', 'production'], + optional: Boolean, + 'package-lock': Boolean, + parseable: Boolean, + 'prefer-offline': Boolean, + 'prefer-online': Boolean, + prefix: path, + production: Boolean, + progress: Boolean, + 'proprietary-attribs': Boolean, + proxy: [null, false, url], + // allow proxy to be disabled explicitly + 'rebuild-bundle': Boolean, + registry: [null, url], + rollback: Boolean, + save: Boolean, + 'save-bundle': Boolean, + 'save-dev': Boolean, + 'save-exact': Boolean, + 'save-optional': Boolean, + 'save-prefix': String, + 'save-prod': Boolean, + scope: String, + 'script-shell': [null, String], + 'scripts-prepend-node-path': [false, true, 'auto', 'warn-only'], + searchopts: String, + searchexclude: [null, String], + searchlimit: Number, + searchstaleness: Number, + 'send-metrics': Boolean, + shell: String, + shrinkwrap: Boolean, + 'sign-git-tag': Boolean, + 'sso-poll-frequency': Number, + 'sso-type': [null, 'oauth', 'saml'], + 'strict-ssl': Boolean, + tag: String, + timing: Boolean, + tmp: path, + unicode: Boolean, + 'unsafe-perm': Boolean, + usage: Boolean, + user: [Number, String], + userconfig: path, + umask: Umask, + version: Boolean, + 'tag-version-prefix': String, + versions: Boolean, + viewer: String, + _exit: Boolean +} - if (Reflect.has(options, 'normalizeHttp')) { - throw new Error('options.normalizeHttp is renamed to options.forceHttps'); - } - if (Reflect.has(options, 'stripFragment')) { - throw new Error('options.stripFragment is renamed to options.stripHash'); - } +/***/ }), - urlString = urlString.trim(); +/***/ 95950: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // Data URL - if (/^data:/i.test(urlString)) { - return normalizeDataURL(urlString, options); - } +"use strict"; - const hasRelativeProtocol = urlString.startsWith('//'); - const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const types = __nccwpck_require__(18406); - // Prepend protocol - if (!isRelativeUrl) { - urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol); +// https://github.com/npm/npm/blob/latest/lib/config/core.js#L409-L423 +const envReplace = str => { + if (typeof str !== 'string' || !str) { + return str; } - const urlObj = new URLParser(urlString); + // Replace any ${ENV} values with the appropriate environment + const regex = /(\\*)\$\{([^}]+)\}/g; - if (options.forceHttp && options.forceHttps) { - throw new Error('The `forceHttp` and `forceHttps` options cannot be used together'); - } + return str.replace(regex, (orig, esc, name) => { + esc = esc.length > 0 && esc.length % 2; - if (options.forceHttp && urlObj.protocol === 'https:') { - urlObj.protocol = 'http:'; - } + if (esc) { + return orig; + } - if (options.forceHttps && urlObj.protocol === 'http:') { - urlObj.protocol = 'https:'; - } + if (process.env[name] === undefined) { + throw new Error(`Failed to replace env in config: ${orig}`); + } - // Remove auth - if (options.stripAuthentication) { - urlObj.username = ''; - urlObj.password = ''; - } + return process.env[name]; + }); +}; - // Remove hash - if (options.stripHash) { - urlObj.hash = ''; +// https://github.com/npm/npm/blob/latest/lib/config/core.js#L362-L407 +const parseField = (field, key) => { + if (typeof field !== 'string') { + return field; } - // Remove duplicate slashes if not preceded by a protocol - if (urlObj.pathname) { - // TODO: Use the following instead when targeting Node.js 10 - // `urlObj.pathname = urlObj.pathname.replace(/(? { - if (/^(?!\/)/g.test(p1)) { - return `${p1}/`; - } + const typeList = [].concat(types[key]); + const isPath = typeList.indexOf(path) !== -1; + const isBool = typeList.indexOf(Boolean) !== -1; + const isString = typeList.indexOf(String) !== -1; + const isNumber = typeList.indexOf(Number) !== -1; - return '/'; - }); - } + field = `${field}`.trim(); - // Decode URI octets - if (urlObj.pathname) { - urlObj.pathname = decodeURI(urlObj.pathname); + if (/^".*"$/.test(field)) { + try { + field = JSON.parse(field); + } catch (err) { + throw new Error(`Failed parsing JSON config key ${key}: ${field}`); + } } - // Remove directory index - if (options.removeDirectoryIndex === true) { - options.removeDirectoryIndex = [/^index\.[a-z]+$/]; + if (isBool && !isString && field === '') { + return true; } - if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) { - let pathComponents = urlObj.pathname.split('/'); - const lastComponent = pathComponents[pathComponents.length - 1]; - - if (testParameter(lastComponent, options.removeDirectoryIndex)) { - pathComponents = pathComponents.slice(0, pathComponents.length - 1); - urlObj.pathname = pathComponents.slice(1).join('/') + '/'; + switch (field) { // eslint-disable-line default-case + case 'true': { + return true; } - } - if (urlObj.hostname) { - // Remove trailing dot - urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); - - // Remove `www.` - if (options.stripWWW && /^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(urlObj.hostname)) { - // Each label should be max 63 at length (min: 2). - // The extension should be max 5 at length (min: 2). - // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names - urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); + case 'false': { + return false; } - } - // Remove query unwanted parameters - if (Array.isArray(options.removeQueryParameters)) { - for (const key of [...urlObj.searchParams.keys()]) { - if (testParameter(key, options.removeQueryParameters)) { - urlObj.searchParams.delete(key); - } + case 'null': { + return null; } - } - // Sort query parameters - if (options.sortQueryParameters) { - urlObj.searchParams.sort(); + case 'undefined': { + return undefined; + } } - if (options.removeTrailingSlash) { - urlObj.pathname = urlObj.pathname.replace(/\/$/, ''); - } + field = envReplace(field); - // Take advantage of many of the Node `url` normalizations - urlString = urlObj.toString(); + if (isPath) { + const regex = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//; - // Remove ending `/` - if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '') { - urlString = urlString.replace(/\/$/, ''); - } + if (regex.test(field) && process.env.HOME) { + field = path.resolve(process.env.HOME, field.substr(2)); + } - // Restore relative protocol, if applicable - if (hasRelativeProtocol && !options.normalizeProtocol) { - urlString = urlString.replace(/^http:\/\//, '//'); + field = path.resolve(field); } - // Remove http/https - if (options.stripProtocol) { - urlString = urlString.replace(/^(?:https?:)?\/\//, ''); + if (isNumber && !field.isNan()) { + field = Number(field); } - return urlString; + return field; }; -module.exports = normalizeUrl; -// TODO: Remove this for the next major release -module.exports.default = normalizeUrl; - - -/***/ }), +// https://github.com/npm/npm/blob/latest/lib/config/find-prefix.js +const findPrefix = name => { + name = path.resolve(name); -/***/ 8569: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + let walkedUp = false; -"use strict"; + while (path.basename(name) === 'node_modules') { + name = path.dirname(name); + walkedUp = true; + } -const path = __webpack_require__(85622); -const Conf = __webpack_require__(12430); -const defaults = __webpack_require__(5473); + if (walkedUp) { + return name; + } -// https://github.com/npm/npm/blob/latest/lib/config/core.js#L101-L200 -module.exports = opts => { - const conf = new Conf(Object.assign({}, defaults.defaults)); + const find = (name, original) => { + const regex = /^[a-zA-Z]:(\\|\/)?$/; - conf.add(Object.assign({}, opts), 'cli'); - conf.addEnv(); - conf.loadPrefix(); + if (name === '/' || (process.platform === 'win32' && regex.test(name))) { + return original; + } - const projectConf = path.resolve(conf.localPrefix, '.npmrc'); - const userConf = conf.get('userconfig'); + try { + const files = fs.readdirSync(name); - if (!conf.get('global') && projectConf !== userConf) { - conf.addFile(projectConf, 'project'); - } else { - conf.add({}, 'project'); - } + if (files.indexOf('node_modules') !== -1 || files.indexOf('package.json') !== -1) { + return name; + } - conf.addFile(conf.get('userconfig'), 'user'); + const dirname = path.dirname(name); - if (conf.get('prefix')) { - const etc = path.resolve(conf.get('prefix'), 'etc'); - conf.root.globalconfig = path.resolve(etc, 'npmrc'); - conf.root.globalignorefile = path.resolve(etc, 'npmignore'); - } + if (dirname === name) { + return original; + } - conf.addFile(conf.get('globalconfig'), 'global'); - conf.loadUser(); + return find(dirname, original); + } catch (err) { + if (name === original) { + if (err.code === 'ENOENT') { + return original; + } - const caFile = conf.get('cafile'); + throw err; + } - if (caFile) { - conf.loadCAFile(caFile); - } + return original; + } + }; - return conf; + return find(name, name); }; -module.exports.defaults = Object.assign({}, defaults.defaults); +exports.envReplace = envReplace; +exports.findPrefix = findPrefix; +exports.parseField = parseField; /***/ }), -/***/ 12430: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 79391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const ConfigChain = __webpack_require__(18271).ConfigChain; -const util = __webpack_require__(95950); +const path = __nccwpck_require__(85622); +const pathKey = __nccwpck_require__(37637); -class Conf extends ConfigChain { - // https://github.com/npm/npm/blob/latest/lib/config/core.js#L208-L222 - constructor(base) { - super(base); - this.root = base; - } +const npmRunPath = options => { + options = { + cwd: process.cwd(), + path: process.env[pathKey()], + execPath: process.execPath, + ...options + }; - // https://github.com/npm/npm/blob/latest/lib/config/core.js#L332-L342 - add(data, marker) { - try { - for (const x of Object.keys(data)) { - data[x] = util.parseField(data[x], x); - } - } catch (err) { - throw err; - } + let previous; + let cwdPath = path.resolve(options.cwd); + const result = []; - return super.add(data, marker); + while (previous !== cwdPath) { + result.push(path.join(cwdPath, 'node_modules/.bin')); + previous = cwdPath; + cwdPath = path.resolve(cwdPath, '..'); } - // https://github.com/npm/npm/blob/latest/lib/config/core.js#L312-L325 - addFile(file, name) { - name = name || file; - - const marker = {__source__: name}; - - this.sources[name] = {path: file, type: 'ini'}; - this.push(marker); - this._await(); - - try { - const contents = fs.readFileSync(file, 'utf8'); - this.addString(contents, file, 'ini', marker); - } catch (err) { - this.add({}, marker); - } - - return this; - } + // Ensure the running `node` binary is used + const execPathDir = path.resolve(options.cwd, options.execPath, '..'); + result.push(execPathDir); - // https://github.com/npm/npm/blob/latest/lib/config/core.js#L344-L360 - addEnv(env) { - env = env || process.env; + return result.concat(options.path).join(path.delimiter); +}; - const conf = {}; +module.exports = npmRunPath; +// TODO: Remove this for the next major release +module.exports.default = npmRunPath; - Object.keys(env) - .filter(x => /^npm_config_/i.test(x)) - .forEach(x => { - if (!env[x]) { - return; - } +module.exports.env = options => { + options = { + env: process.env, + ...options + }; - const p = x.toLowerCase() - .replace(/^npm_config_/, '') - .replace(/(?!^)_/g, '-'); + const env = {...options.env}; + const path = pathKey({env}); - conf[p] = env[x]; - }); + options.path = env[path]; + env[path] = module.exports(options); - return super.addEnv('', conf, 'env'); - } + return env; +}; - // https://github.com/npm/npm/blob/latest/lib/config/load-prefix.js - loadPrefix() { - const cli = this.list[0]; - Object.defineProperty(this, 'prefix', { - enumerable: true, - set: prefix => { - const g = this.get('global'); - this[g ? 'globalPrefix' : 'localPrefix'] = prefix; - }, - get: () => { - const g = this.get('global'); - return g ? this.globalPrefix : this.localPrefix; - } - }); +/***/ }), - Object.defineProperty(this, 'globalPrefix', { - enumerable: true, - set: prefix => { - this.set('prefix', prefix); - }, - get: () => { - return path.resolve(this.get('prefix')); - } - }); +/***/ 37971: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - let p; +"use strict"; - Object.defineProperty(this, 'localPrefix', { - enumerable: true, - set: prefix => { - p = prefix; - }, - get: () => { - return p; - } - }); - if (Object.prototype.hasOwnProperty.call(cli, 'prefix')) { - p = path.resolve(cli.prefix); - } else { +var keysShim; +if (!Object.keys) { + // modified from https://github.com/es-shims/es5-shim + var has = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var isArgs = __nccwpck_require__(10243); // eslint-disable-line global-require + var isEnumerable = Object.prototype.propertyIsEnumerable; + var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); + var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); + var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + var hasAutomationEqualityBug = (function () { + /* global window */ + if (typeof window === 'undefined') { return false; } + for (var k in window) { try { - const prefix = util.findPrefix(process.cwd()); - p = prefix; - } catch (err) { - throw err; + if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { + try { + equalsConstructorPrototype(window[k]); + } catch (e) { + return true; + } + } + } catch (e) { + return true; } } - - return p; - } - - // https://github.com/npm/npm/blob/latest/lib/config/load-cafile.js - loadCAFile(file) { - if (!file) { - return; + return false; + }()); + var equalsConstructorPrototypeIfNotBuggy = function (o) { + /* global window */ + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o); } - try { - const contents = fs.readFileSync(file, 'utf8'); - const delim = '-----END CERTIFICATE-----'; - const output = contents - .split(delim) - .filter(x => Boolean(x.trim())) - .map(x => x.trimLeft() + delim); + return equalsConstructorPrototype(o); + } catch (e) { + return false; + } + }; - this.set('ca', output); - } catch (err) { - if (err.code === 'ENOENT') { - return; - } + keysShim = function keys(object) { + var isObject = object !== null && typeof object === 'object'; + var isFunction = toStr.call(object) === '[object Function]'; + var isArguments = isArgs(object); + var isString = isObject && toStr.call(object) === '[object String]'; + var theKeys = []; - throw err; + if (!isObject && !isFunction && !isArguments) { + throw new TypeError('Object.keys called on a non-object'); } - } - - // https://github.com/npm/npm/blob/latest/lib/config/set-user.js - loadUser() { - const defConf = this.root; - if (this.get('global')) { - return; + var skipProto = hasProtoEnumBug && isFunction; + if (isString && object.length > 0 && !has.call(object, 0)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)); + } } - if (process.env.SUDO_UID) { - defConf.user = Number(process.env.SUDO_UID); - return; + if (isArguments && object.length > 0) { + for (var j = 0; j < object.length; ++j) { + theKeys.push(String(j)); + } + } else { + for (var name in object) { + if (!(skipProto && name === 'prototype') && has.call(object, name)) { + theKeys.push(String(name)); + } + } } - const prefix = path.resolve(this.get('prefix')); + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); - try { - const stats = fs.statSync(prefix); - defConf.user = stats.uid; - } catch (err) { - if (err.code === 'ENOENT') { - return; + for (var k = 0; k < dontEnums.length; ++k) { + if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { + theKeys.push(dontEnums[k]); + } } - - throw err; } - } + return theKeys; + }; } - -module.exports = Conf; +module.exports = keysShim; /***/ }), -/***/ 5473: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ 28777: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; - // Generated with `lib/make.js` - - const os = __webpack_require__(12087); - const path = __webpack_require__(85622); - - const temp = os.tmpdir(); - const uidOrPid = process.getuid ? process.getuid() : process.pid; - const hasUnicode = () => true; - const isWindows = process.platform === 'win32'; - const osenv = { - editor: () => process.env.EDITOR || process.env.VISUAL || (isWindows ? 'notepad.exe' : 'vi'), - shell: () => isWindows ? (process.env.COMSPEC || 'cmd.exe') : (process.env.SHELL || '/bin/bash') - }; +var slice = Array.prototype.slice; +var isArgs = __nccwpck_require__(10243); - const umask = { - fromString: () => process.umask() - }; +var origKeys = Object.keys; +var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __nccwpck_require__(37971); - let home = os.homedir(); +var originalKeys = Object.keys; - if (home) { - process.env.HOME = home; +keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = (function () { + // Safari 5.0 bug + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2)); + if (!keysWorksWithArguments) { + Object.keys = function keys(object) { // eslint-disable-line func-name-matching + if (isArgs(object)) { + return originalKeys(slice.call(object)); + } + return originalKeys(object); + }; + } } else { - home = path.resolve(temp, 'npm-' + uidOrPid); + Object.keys = keysShim; } + return Object.keys || keysShim; +}; - const cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm'; - const cacheRoot = process.platform === 'win32' ? process.env.APPDATA : home; - const cache = path.resolve(cacheRoot, cacheExtra); +module.exports = keysShim; - let defaults; - let globalPrefix; - Object.defineProperty(exports, "defaults", ({ - get: function () { - if (defaults) return defaults; +/***/ }), - if (process.env.PREFIX) { - globalPrefix = process.env.PREFIX; - } else if (process.platform === 'win32') { - // c:\node\node.exe --> prefix=c:\node\ - globalPrefix = path.dirname(process.execPath); - } else { - // /usr/local/bin/node --> prefix=/usr/local - globalPrefix = path.dirname(path.dirname(process.execPath)); // destdir only is respected on Unix +/***/ 10243: +/***/ ((module) => { - if (process.env.DESTDIR) { - globalPrefix = path.join(process.env.DESTDIR, globalPrefix); - } - } +"use strict"; - defaults = { - access: null, - 'allow-same-version': false, - 'always-auth': false, - also: null, - 'auth-type': 'legacy', - 'bin-links': true, - browser: null, - ca: null, - cafile: null, - cache: cache, - 'cache-lock-stale': 60000, - 'cache-lock-retries': 10, - 'cache-lock-wait': 10000, - 'cache-max': Infinity, - 'cache-min': 10, - cert: null, - color: true, - depth: Infinity, - description: true, - dev: false, - 'dry-run': false, - editor: osenv.editor(), - 'engine-strict': false, - force: false, - 'fetch-retries': 2, - 'fetch-retry-factor': 10, - 'fetch-retry-mintimeout': 10000, - 'fetch-retry-maxtimeout': 60000, - git: 'git', - 'git-tag-version': true, - global: false, - globalconfig: path.resolve(globalPrefix, 'etc', 'npmrc'), - 'global-style': false, - group: process.platform === 'win32' ? 0 : process.env.SUDO_GID || process.getgid && process.getgid(), - 'ham-it-up': false, - heading: 'npm', - 'if-present': false, - 'ignore-prepublish': false, - 'ignore-scripts': false, - 'init-module': path.resolve(home, '.npm-init.js'), - 'init-author-name': '', - 'init-author-email': '', - 'init-author-url': '', - 'init-version': '1.0.0', - 'init-license': 'ISC', - json: false, - key: null, - 'legacy-bundling': false, - link: false, - 'local-address': undefined, - loglevel: 'notice', - logstream: process.stderr, - 'logs-max': 10, - long: false, - maxsockets: 50, - message: '%s', - 'metrics-registry': null, - 'node-version': process.version, - 'offline': false, - 'onload-script': false, - only: null, - optional: true, - 'package-lock': true, - parseable: false, - 'prefer-offline': false, - 'prefer-online': false, - prefix: globalPrefix, - production: process.env.NODE_ENV === 'production', - 'progress': !process.env.TRAVIS && !process.env.CI, - 'proprietary-attribs': true, - proxy: null, - 'https-proxy': null, - 'user-agent': 'npm/{npm-version} ' + 'node/{node-version} ' + '{platform} ' + '{arch}', - 'rebuild-bundle': true, - registry: 'https://registry.npmjs.org/', - rollback: true, - save: true, - 'save-bundle': false, - 'save-dev': false, - 'save-exact': false, - 'save-optional': false, - 'save-prefix': '^', - 'save-prod': false, - scope: '', - 'script-shell': null, - 'scripts-prepend-node-path': 'warn-only', - searchopts: '', - searchexclude: null, - searchlimit: 20, - searchstaleness: 15 * 60, - 'send-metrics': false, - shell: osenv.shell(), - shrinkwrap: true, - 'sign-git-tag': false, - 'sso-poll-frequency': 500, - 'sso-type': 'oauth', - 'strict-ssl': true, - tag: 'latest', - 'tag-version-prefix': 'v', - timing: false, - tmp: temp, - unicode: hasUnicode(), - 'unsafe-perm': process.platform === 'win32' || process.platform === 'cygwin' || !(process.getuid && process.setuid && process.getgid && process.setgid) || process.getuid() !== 0, - usage: false, - user: process.platform === 'win32' ? 0 : 'nobody', - userconfig: path.resolve(home, '.npmrc'), - umask: process.umask ? process.umask() : umask.fromString('022'), - version: false, - versions: false, - viewer: process.platform === 'win32' ? 'browser' : 'man', - _exit: true - }; - return defaults; - } -})) + +var toStr = Object.prototype.toString; + +module.exports = function isArguments(value) { + var str = toStr.call(value); + var isArgs = str === '[object Arguments]'; + if (!isArgs) { + isArgs = str !== '[object Array]' && + value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr.call(value.callee) === '[object Function]'; + } + return isArgs; +}; /***/ }), -/***/ 18406: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ 96754: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var wrappy = __nccwpck_require__(83640) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) - // Generated with `lib/make.js` - - const path = __webpack_require__(85622); - const Stream = __webpack_require__(92413).Stream; - const url = __webpack_require__(78835); +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) - const Umask = () => {}; - const getLocalAddresses = () => []; - const semver = () => {}; + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) - exports.types = { - access: [null, 'restricted', 'public'], - 'allow-same-version': Boolean, - 'always-auth': Boolean, - also: [null, 'dev', 'development'], - 'auth-type': ['legacy', 'sso', 'saml', 'oauth'], - 'bin-links': Boolean, - browser: [null, String], - ca: [null, String, Array], - cafile: path, - cache: path, - 'cache-lock-stale': Number, - 'cache-lock-retries': Number, - 'cache-lock-wait': Number, - 'cache-max': Number, - 'cache-min': Number, - cert: [null, String], - color: ['always', Boolean], - depth: Number, - description: Boolean, - dev: Boolean, - 'dry-run': Boolean, - editor: String, - 'engine-strict': Boolean, - force: Boolean, - 'fetch-retries': Number, - 'fetch-retry-factor': Number, - 'fetch-retry-mintimeout': Number, - 'fetch-retry-maxtimeout': Number, - git: String, - 'git-tag-version': Boolean, - global: Boolean, - globalconfig: path, - 'global-style': Boolean, - group: [Number, String], - 'https-proxy': [null, url], - 'user-agent': String, - 'ham-it-up': Boolean, - 'heading': String, - 'if-present': Boolean, - 'ignore-prepublish': Boolean, - 'ignore-scripts': Boolean, - 'init-module': path, - 'init-author-name': String, - 'init-author-email': String, - 'init-author-url': ['', url], - 'init-license': String, - 'init-version': semver, - json: Boolean, - key: [null, String], - 'legacy-bundling': Boolean, - link: Boolean, - // local-address must be listed as an IP for a local network interface - // must be IPv4 due to node bug - 'local-address': getLocalAddresses(), - loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'], - logstream: Stream, - 'logs-max': Number, - long: Boolean, - maxsockets: Number, - message: String, - 'metrics-registry': [null, String], - 'node-version': [null, semver], - offline: Boolean, - 'onload-script': [null, String], - only: [null, 'dev', 'development', 'prod', 'production'], - optional: Boolean, - 'package-lock': Boolean, - parseable: Boolean, - 'prefer-offline': Boolean, - 'prefer-online': Boolean, - prefix: path, - production: Boolean, - progress: Boolean, - 'proprietary-attribs': Boolean, - proxy: [null, false, url], - // allow proxy to be disabled explicitly - 'rebuild-bundle': Boolean, - registry: [null, url], - rollback: Boolean, - save: Boolean, - 'save-bundle': Boolean, - 'save-dev': Boolean, - 'save-exact': Boolean, - 'save-optional': Boolean, - 'save-prefix': String, - 'save-prod': Boolean, - scope: String, - 'script-shell': [null, String], - 'scripts-prepend-node-path': [false, true, 'auto', 'warn-only'], - searchopts: String, - searchexclude: [null, String], - searchlimit: Number, - searchstaleness: Number, - 'send-metrics': Boolean, - shell: String, - shrinkwrap: Boolean, - 'sign-git-tag': Boolean, - 'sso-poll-frequency': Number, - 'sso-type': [null, 'oauth', 'saml'], - 'strict-ssl': Boolean, - tag: String, - timing: Boolean, - tmp: path, - unicode: Boolean, - 'unsafe-perm': Boolean, - usage: Boolean, - user: [Number, String], - userconfig: path, - umask: Umask, - version: Boolean, - 'tag-version-prefix': String, - versions: Boolean, - viewer: String, - _exit: Boolean +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f } /***/ }), -/***/ 95950: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ 81053: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const types = __webpack_require__(18406); +const mimicFn = __nccwpck_require__(71883); -// https://github.com/npm/npm/blob/latest/lib/config/core.js#L409-L423 -const envReplace = str => { - if (typeof str !== 'string' || !str) { - return str; +const calledFunctions = new WeakMap(); + +const onetime = (function_, options = {}) => { + if (typeof function_ !== 'function') { + throw new TypeError('Expected a function'); } - // Replace any ${ENV} values with the appropriate environment - const regex = /(\\*)\$\{([^}]+)\}/g; + let returnValue; + let callCount = 0; + const functionName = function_.displayName || function_.name || ''; - return str.replace(regex, (orig, esc, name) => { - esc = esc.length > 0 && esc.length % 2; + const onetime = function (...arguments_) { + calledFunctions.set(onetime, ++callCount); - if (esc) { - return orig; + if (callCount === 1) { + returnValue = function_.apply(this, arguments_); + function_ = null; + } else if (options.throw === true) { + throw new Error(`Function \`${functionName}\` can only be called once`); } - if (process.env[name] === undefined) { - throw new Error(`Failed to replace env in config: ${orig}`); - } + return returnValue; + }; - return process.env[name]; - }); + mimicFn(onetime, function_); + calledFunctions.set(onetime, callCount); + + return onetime; }; -// https://github.com/npm/npm/blob/latest/lib/config/core.js#L362-L407 -const parseField = (field, key) => { - if (typeof field !== 'string') { - return field; +module.exports = onetime; +// TODO: Remove this for the next major release +module.exports.default = onetime; + +module.exports.callCount = function_ => { + if (!calledFunctions.has(function_)) { + throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); } - const typeList = [].concat(types[key]); - const isPath = typeList.indexOf(path) !== -1; - const isBool = typeList.indexOf(Boolean) !== -1; - const isString = typeList.indexOf(String) !== -1; - const isNumber = typeList.indexOf(Number) !== -1; + return calledFunctions.get(function_); +}; - field = `${field}`.trim(); - if (/^".*"$/.test(field)) { - try { - field = JSON.parse(field); - } catch (err) { - throw new Error(`Failed parsing JSON config key ${key}: ${field}`); - } +/***/ }), + +/***/ 5420: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const readline = __nccwpck_require__(51058); +const chalk = __nccwpck_require__(7833); +const cliCursor = __nccwpck_require__(87400); +const cliSpinners = __nccwpck_require__(63488); +const logSymbols = __nccwpck_require__(87279); +const stripAnsi = __nccwpck_require__(26301); +const wcwidth = __nccwpck_require__(25997); +const isInteractive = __nccwpck_require__(47133); +const {BufferListStream} = __nccwpck_require__(93453); + +const TEXT = Symbol('text'); +const PREFIX_TEXT = Symbol('prefixText'); + +const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code + +const terminalSupportsUnicode = () => ( + process.platform !== 'win32' || + process.env.TERM_PROGRAM === 'vscode' || + Boolean(process.env.WT_SESSION) +); + +class StdinDiscarder { + constructor() { + this.requests = 0; + + this.mutedStream = new BufferListStream(); + this.mutedStream.pipe(process.stdout); + + const self = this; + this.ourEmit = function (event, data, ...args) { + const {stdin} = process; + if (self.requests > 0 || stdin.emit === self.ourEmit) { + if (event === 'keypress') { // Fixes readline behavior + return; + } + + if (event === 'data' && data.includes(ASCII_ETX_CODE)) { + process.emit('SIGINT'); + } + + Reflect.apply(self.oldEmit, this, [event, data, ...args]); + } else { + Reflect.apply(process.stdin.emit, this, [event, data, ...args]); + } + }; } - if (isBool && !isString && field === '') { - return true; + start() { + this.requests++; + + if (this.requests === 1) { + this.realStart(); + } } - switch (field) { // eslint-disable-line default-case - case 'true': { - return true; + stop() { + if (this.requests <= 0) { + throw new Error('`stop` called more times than `start`'); } - case 'false': { - return false; + this.requests--; + + if (this.requests === 0) { + this.realStop(); } + } - case 'null': { - return null; + realStart() { + // No known way to make it work reliably on Windows + if (process.platform === 'win32') { + return; } - case 'undefined': { - return undefined; + this.rl = readline.createInterface({ + input: process.stdin, + output: this.mutedStream + }); + + this.rl.on('SIGINT', () => { + if (process.listenerCount('SIGINT') === 0) { + process.emit('SIGINT'); + } else { + this.rl.close(); + process.kill(process.pid, 'SIGINT'); + } + }); + } + + realStop() { + if (process.platform === 'win32') { + return; } + + this.rl.close(); + this.rl = undefined; } +} - field = envReplace(field); +let stdinDiscarder; - if (isPath) { - const regex = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//; +class Ora { + constructor(options) { + if (!stdinDiscarder) { + stdinDiscarder = new StdinDiscarder(); + } - if (regex.test(field) && process.env.HOME) { - field = path.resolve(process.env.HOME, field.substr(2)); + if (typeof options === 'string') { + options = { + text: options + }; } - field = path.resolve(field); - } + this.options = { + text: '', + color: 'cyan', + stream: process.stderr, + discardStdin: true, + ...options + }; - if (isNumber && !field.isNan()) { - field = Number(field); + this.spinner = this.options.spinner; + + this.color = this.options.color; + this.hideCursor = this.options.hideCursor !== false; + this.interval = this.options.interval || this.spinner.interval || 100; + this.stream = this.options.stream; + this.id = undefined; + this.isEnabled = typeof this.options.isEnabled === 'boolean' ? this.options.isEnabled : isInteractive({stream: this.stream}); + this.isSilent = typeof this.options.isSilent === 'boolean' ? this.options.isSilent : false; + + // Set *after* `this.stream` + this.text = this.options.text; + this.prefixText = this.options.prefixText; + this.linesToClear = 0; + this.indent = this.options.indent; + this.discardStdin = this.options.discardStdin; + this.isDiscardingStdin = false; } - return field; -}; + get indent() { + return this._indent; + } -// https://github.com/npm/npm/blob/latest/lib/config/find-prefix.js -const findPrefix = name => { - name = path.resolve(name); + set indent(indent = 0) { + if (!(indent >= 0 && Number.isInteger(indent))) { + throw new Error('The `indent` option must be an integer from 0 and up'); + } - let walkedUp = false; + this._indent = indent; + } - while (path.basename(name) === 'node_modules') { - name = path.dirname(name); - walkedUp = true; + _updateInterval(interval) { + if (interval !== undefined) { + this.interval = interval; + } } - if (walkedUp) { - return name; + get spinner() { + return this._spinner; } - const find = (name, original) => { - const regex = /^[a-zA-Z]:(\\|\/)?$/; + set spinner(spinner) { + this.frameIndex = 0; - if (name === '/' || (process.platform === 'win32' && regex.test(name))) { - return original; + if (typeof spinner === 'object') { + if (spinner.frames === undefined) { + throw new Error('The given spinner must have a `frames` property'); + } + + this._spinner = spinner; + } else if (!terminalSupportsUnicode()) { + this._spinner = cliSpinners.line; + } else if (spinner === undefined) { + // Set default spinner + this._spinner = cliSpinners.dots; + } else if (cliSpinners[spinner]) { + this._spinner = cliSpinners[spinner]; + } else { + throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json for a full list.`); } - try { - const files = fs.readdirSync(name); + this._updateInterval(this._spinner.interval); + } - if (files.indexOf('node_modules') !== -1 || files.indexOf('package.json') !== -1) { - return name; - } + get text() { + return this[TEXT]; + } - const dirname = path.dirname(name); + set text(value) { + this[TEXT] = value; + this.updateLineCount(); + } - if (dirname === name) { - return original; - } + get prefixText() { + return this[PREFIX_TEXT]; + } - return find(dirname, original); - } catch (err) { - if (name === original) { - if (err.code === 'ENOENT') { - return original; - } + set prefixText(value) { + this[PREFIX_TEXT] = value; + this.updateLineCount(); + } - throw err; - } + get isSpinning() { + return this.id !== undefined; + } - return original; + getFullPrefixText(prefixText = this[PREFIX_TEXT], postfix = ' ') { + if (typeof prefixText === 'string') { + return prefixText + postfix; } - }; - - return find(name, name); -}; -exports.envReplace = envReplace; -exports.findPrefix = findPrefix; -exports.parseField = parseField; + if (typeof prefixText === 'function') { + return prefixText() + postfix; + } + return ''; + } -/***/ }), + updateLineCount() { + const columns = this.stream.columns || 80; + const fullPrefixText = this.getFullPrefixText(this.prefixText, '-'); + this.lineCount = 0; + for (const line of stripAnsi(fullPrefixText + '--' + this[TEXT]).split('\n')) { + this.lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns)); + } + } -/***/ 79391: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + get isEnabled() { + return this._isEnabled && !this.isSilent; + } -"use strict"; + set isEnabled(value) { + if (typeof value !== 'boolean') { + throw new TypeError('The `isEnabled` option must be a boolean'); + } -const path = __webpack_require__(85622); -const pathKey = __webpack_require__(59086); + this._isEnabled = value; + } -const npmRunPath = options => { - options = { - cwd: process.cwd(), - path: process.env[pathKey()], - execPath: process.execPath, - ...options - }; + get isSilent() { + return this._isSilent; + } - let previous; - let cwdPath = path.resolve(options.cwd); - const result = []; + set isSilent(value) { + if (typeof value !== 'boolean') { + throw new TypeError('The `isSilent` option must be a boolean'); + } - while (previous !== cwdPath) { - result.push(path.join(cwdPath, 'node_modules/.bin')); - previous = cwdPath; - cwdPath = path.resolve(cwdPath, '..'); + this._isSilent = value; } - // Ensure the running `node` binary is used - const execPathDir = path.resolve(options.cwd, options.execPath, '..'); - result.push(execPathDir); + frame() { + const {frames} = this.spinner; + let frame = frames[this.frameIndex]; - return result.concat(options.path).join(path.delimiter); -}; + if (this.color) { + frame = chalk[this.color](frame); + } -module.exports = npmRunPath; -// TODO: Remove this for the next major release -module.exports.default = npmRunPath; + this.frameIndex = ++this.frameIndex % frames.length; + const fullPrefixText = (typeof this.prefixText === 'string' && this.prefixText !== '') ? this.prefixText + ' ' : ''; + const fullText = typeof this.text === 'string' ? ' ' + this.text : ''; -module.exports.env = options => { - options = { - env: process.env, - ...options - }; + return fullPrefixText + frame + fullText; + } + + clear() { + if (!this.isEnabled || !this.stream.isTTY) { + return this; + } + + for (let i = 0; i < this.linesToClear; i++) { + if (i > 0) { + this.stream.moveCursor(0, -1); + } + + this.stream.clearLine(); + this.stream.cursorTo(this.indent); + } - const env = {...options.env}; - const path = pathKey({env}); + this.linesToClear = 0; - options.path = env[path]; - env[path] = module.exports(options); + return this; + } - return env; -}; + render() { + if (this.isSilent) { + return this; + } + this.clear(); + this.stream.write(this.frame()); + this.linesToClear = this.lineCount; -/***/ }), + return this; + } -/***/ 59086: -/***/ ((module) => { + start(text) { + if (text) { + this.text = text; + } -"use strict"; + if (this.isSilent) { + return this; + } + if (!this.isEnabled) { + if (this.text) { + this.stream.write(`- ${this.text}\n`); + } -const pathKey = (options = {}) => { - const environment = options.env || process.env; - const platform = options.platform || process.platform; + return this; + } - if (platform !== 'win32') { - return 'PATH'; - } + if (this.isSpinning) { + return this; + } - return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; -}; + if (this.hideCursor) { + cliCursor.hide(this.stream); + } -module.exports = pathKey; -// TODO: Remove this for the next major release -module.exports.default = pathKey; + if (this.discardStdin && process.stdin.isTTY) { + this.isDiscardingStdin = true; + stdinDiscarder.start(); + } + this.render(); + this.id = setInterval(this.render.bind(this), this.interval); -/***/ }), + return this; + } -/***/ 14594: -/***/ ((module) => { + stop() { + if (!this.isEnabled) { + return this; + } -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ + clearInterval(this.id); + this.id = undefined; + this.frameIndex = 0; + this.clear(); + if (this.hideCursor) { + cliCursor.show(this.stream); + } + if (this.discardStdin && process.stdin.isTTY && this.isDiscardingStdin) { + stdinDiscarder.stop(); + this.isDiscardingStdin = false; + } -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; + return this; + } -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); + succeed(text) { + return this.stopAndPersist({symbol: logSymbols.success, text}); } - return Object(val); -} + fail(text) { + return this.stopAndPersist({symbol: logSymbols.error, text}); + } -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } + warn(text) { + return this.stopAndPersist({symbol: logSymbols.warning, text}); + } - // Detect buggy property enumeration order in older V8 versions. + info(text) { + return this.stopAndPersist({symbol: logSymbols.info, text}); + } - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; + stopAndPersist(options = {}) { + if (this.isSilent) { + return this; } - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } + const prefixText = options.prefixText || this.prefixText; + const text = options.text || this.text; + const fullText = (typeof text === 'string') ? ' ' + text : ''; - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } + this.stop(); + this.stream.write(`${this.getFullPrefixText(prefixText, ' ')}${options.symbol || ' '}${fullText}\n`); - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; + return this; } } -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; +const oraFactory = function (options) { + return new Ora(options); +}; - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); +module.exports = oraFactory; - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } +module.exports.promise = (action, options) => { + // eslint-disable-next-line promise/prefer-await-to-then + if (typeof action.then !== 'function') { + throw new TypeError('Parameter `action` must be a Promise'); + } - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } + const spinner = new Ora(options); + spinner.start(); + + (async () => { + try { + await action; + spinner.succeed(); + } catch { + spinner.fail(); } - } + })(); - return to; + return spinner; }; /***/ }), -/***/ 37971: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 87400: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +const restoreCursor = __nccwpck_require__(37463); -var keysShim; -if (!Object.keys) { - // modified from https://github.com/es-shims/es5-shim - var has = Object.prototype.hasOwnProperty; - var toStr = Object.prototype.toString; - var isArgs = __webpack_require__(10243); // eslint-disable-line global-require - var isEnumerable = Object.prototype.propertyIsEnumerable; - var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); - var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); - var dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' - ]; - var equalsConstructorPrototype = function (o) { - var ctor = o.constructor; - return ctor && ctor.prototype === o; - }; - var excludedKeys = { - $applicationCache: true, - $console: true, - $external: true, - $frame: true, - $frameElement: true, - $frames: true, - $innerHeight: true, - $innerWidth: true, - $onmozfullscreenchange: true, - $onmozfullscreenerror: true, - $outerHeight: true, - $outerWidth: true, - $pageXOffset: true, - $pageYOffset: true, - $parent: true, - $scrollLeft: true, - $scrollTop: true, - $scrollX: true, - $scrollY: true, - $self: true, - $webkitIndexedDB: true, - $webkitStorageInfo: true, - $window: true - }; - var hasAutomationEqualityBug = (function () { - /* global window */ - if (typeof window === 'undefined') { return false; } - for (var k in window) { - try { - if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { - try { - equalsConstructorPrototype(window[k]); - } catch (e) { - return true; - } - } - } catch (e) { - return true; - } - } - return false; - }()); - var equalsConstructorPrototypeIfNotBuggy = function (o) { - /* global window */ - if (typeof window === 'undefined' || !hasAutomationEqualityBug) { - return equalsConstructorPrototype(o); - } - try { - return equalsConstructorPrototype(o); - } catch (e) { - return false; - } - }; +let isHidden = false; - keysShim = function keys(object) { - var isObject = object !== null && typeof object === 'object'; - var isFunction = toStr.call(object) === '[object Function]'; - var isArguments = isArgs(object); - var isString = isObject && toStr.call(object) === '[object String]'; - var theKeys = []; +exports.show = (writableStream = process.stderr) => { + if (!writableStream.isTTY) { + return; + } - if (!isObject && !isFunction && !isArguments) { - throw new TypeError('Object.keys called on a non-object'); - } + isHidden = false; + writableStream.write('\u001B[?25h'); +}; - var skipProto = hasProtoEnumBug && isFunction; - if (isString && object.length > 0 && !has.call(object, 0)) { - for (var i = 0; i < object.length; ++i) { - theKeys.push(String(i)); - } - } +exports.hide = (writableStream = process.stderr) => { + if (!writableStream.isTTY) { + return; + } - if (isArguments && object.length > 0) { - for (var j = 0; j < object.length; ++j) { - theKeys.push(String(j)); - } - } else { - for (var name in object) { - if (!(skipProto && name === 'prototype') && has.call(object, name)) { - theKeys.push(String(name)); - } - } - } + restoreCursor(); + isHidden = true; + writableStream.write('\u001B[?25l'); +}; - if (hasDontEnumBug) { - var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); +exports.toggle = (force, writableStream) => { + if (force !== undefined) { + isHidden = force; + } - for (var k = 0; k < dontEnums.length; ++k) { - if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { - theKeys.push(dontEnums[k]); - } - } - } - return theKeys; - }; -} -module.exports = keysShim; + if (isHidden) { + exports.show(writableStream); + } else { + exports.hide(writableStream); + } +}; /***/ }), -/***/ 28777: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 37463: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +const onetime = __nccwpck_require__(81053); +const signalExit = __nccwpck_require__(22317); -var slice = Array.prototype.slice; -var isArgs = __webpack_require__(10243); +module.exports = onetime(() => { + signalExit(() => { + process.stderr.write('\u001B[?25h'); + }, {alwaysLast: true}); +}); -var origKeys = Object.keys; -var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(37971); -var originalKeys = Object.keys; +/***/ }), -keysShim.shim = function shimObjectKeys() { - if (Object.keys) { - var keysWorksWithArguments = (function () { - // Safari 5.0 bug - var args = Object.keys(arguments); - return args && args.length === arguments.length; - }(1, 2)); - if (!keysWorksWithArguments) { - Object.keys = function keys(object) { // eslint-disable-line func-name-matching - if (isArgs(object)) { - return originalKeys(slice.call(object)); - } - return originalKeys(object); - }; - } - } else { - Object.keys = keysShim; +/***/ 76348: +/***/ ((module) => { + +"use strict"; + + +class CancelError extends Error { + constructor(reason) { + super(reason || 'Promise was canceled'); + this.name = 'CancelError'; } - return Object.keys || keysShim; -}; -module.exports = keysShim; + get isCanceled() { + return true; + } +} +class PCancelable { + static fn(userFn) { + return (...args) => { + return new PCancelable((resolve, reject, onCancel) => { + args.push(onCancel); + userFn(...args).then(resolve, reject); + }); + }; + } -/***/ }), + constructor(executor) { + this._cancelHandlers = []; + this._isPending = true; + this._isCanceled = false; + this._rejectOnCancel = true; -/***/ 10243: -/***/ ((module) => { + this._promise = new Promise((resolve, reject) => { + this._reject = reject; -"use strict"; + const onResolve = value => { + this._isPending = false; + resolve(value); + }; + const onReject = error => { + this._isPending = false; + reject(error); + }; -var toStr = Object.prototype.toString; + const onCancel = handler => { + this._cancelHandlers.push(handler); + }; -module.exports = function isArguments(value) { - var str = toStr.call(value); - var isArgs = str === '[object Arguments]'; - if (!isArgs) { - isArgs = str !== '[object Array]' && - value !== null && - typeof value === 'object' && - typeof value.length === 'number' && - value.length >= 0 && - toStr.call(value.callee) === '[object Function]'; + Object.defineProperties(onCancel, { + shouldReject: { + get: () => this._rejectOnCancel, + set: bool => { + this._rejectOnCancel = bool; + } + } + }); + + return executor(onResolve, onReject, onCancel); + }); } - return isArgs; -}; + then(onFulfilled, onRejected) { + return this._promise.then(onFulfilled, onRejected); + } -/***/ }), + catch(onRejected) { + return this._promise.catch(onRejected); + } -/***/ 96754: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + finally(onFinally) { + return this._promise.finally(onFinally); + } -var wrappy = __webpack_require__(83640) -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) + cancel(reason) { + if (!this._isPending || this._isCanceled) { + return; + } -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) + if (this._cancelHandlers.length > 0) { + try { + for (const handler of this._cancelHandlers) { + handler(); + } + } catch (error) { + this._reject(error); + } + } - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) + this._isCanceled = true; + if (this._rejectOnCancel) { + this._reject(new CancelError(reason)); + } + } -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f + get isCanceled() { + return this._isCanceled; + } } -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} +Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); + +module.exports = PCancelable; +module.exports.default = PCancelable; + +module.exports.CancelError = CancelError; /***/ }), -/***/ 81053: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 18884: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const mimicFn = __webpack_require__(71883); - -const calledFunctions = new WeakMap(); +const pTry = __nccwpck_require__(84944); -const oneTime = (fn, options = {}) => { - if (typeof fn !== 'function') { - throw new TypeError('Expected a function'); +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); } - let ret; - let isCalled = false; - let callCount = 0; - const functionName = fn.displayName || fn.name || ''; - - const onetime = function (...args) { - calledFunctions.set(onetime, ++callCount); + const queue = []; + let activeCount = 0; - if (isCalled) { - if (options.throw === true) { - throw new Error(`Function \`${functionName}\` can only be called once`); - } + const next = () => { + activeCount--; - return ret; + if (queue.length > 0) { + queue.shift()(); } + }; - isCalled = true; - ret = fn.apply(this, args); - fn = null; + const run = (fn, resolve, ...args) => { + activeCount++; - return ret; - }; + const result = pTry(fn, ...args); - mimicFn(onetime, fn); - calledFunctions.set(onetime, callCount); + resolve(result); - return onetime; -}; + result.then(next, next); + }; -module.exports = oneTime; -// TODO: Remove this for the next major release -module.exports.default = oneTime; + const enqueue = (fn, resolve, ...args) => { + if (activeCount < concurrency) { + run(fn, resolve, ...args); + } else { + queue.push(run.bind(null, fn, resolve, ...args)); + } + }; -module.exports.callCount = fn => { - if (!calledFunctions.has(fn)) { - throw new Error(`The given function \`${fn.name}\` is not wrapped by the \`onetime\` package`); - } + const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.length + }, + clearQueue: { + value: () => { + queue.length = 0; + } + } + }); - return calledFunctions.get(fn); + return generator; }; +module.exports = pLimit; +module.exports.default = pLimit; + /***/ }), -/***/ 5420: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 60364: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const readline = __webpack_require__(51058); -const chalk = __webpack_require__(7833); -const cliCursor = __webpack_require__(87400); -const cliSpinners = __webpack_require__(63488); -const logSymbols = __webpack_require__(87279); -const stripAnsi = __webpack_require__(26301); -const wcwidth = __webpack_require__(25997); -const isInteractive = __webpack_require__(47133); -const MuteStream = __webpack_require__(64003); - -const TEXT = Symbol('text'); -const PREFIX_TEXT = Symbol('prefixText'); - -const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code - -class StdinDiscarder { - constructor() { - this.requests = 0; - - this.mutedStream = new MuteStream(); - this.mutedStream.pipe(process.stdout); - this.mutedStream.mute(); - - const self = this; - this.ourEmit = function (event, data, ...args) { - const {stdin} = process; - if (self.requests > 0 || stdin.emit === self.ourEmit) { - if (event === 'keypress') { // Fixes readline behavior - return; - } - - if (event === 'data' && data.includes(ASCII_ETX_CODE)) { - process.emit('SIGINT'); - } +const pLimit = __nccwpck_require__(18884); - Reflect.apply(self.oldEmit, this, [event, data, ...args]); - } else { - Reflect.apply(process.stdin.emit, this, [event, data, ...args]); - } - }; +class EndError extends Error { + constructor(value) { + super(); + this.value = value; } +} - start() { - this.requests++; +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); - if (this.requests === 1) { - this.realStart(); - } +// The input can also be a promise, so we `Promise.all()` them both +const finder = async element => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); } - stop() { - if (this.requests <= 0) { - throw new Error('`stop` called more times than `start`'); - } - - this.requests--; + return false; +}; - if (this.requests === 0) { - this.realStop(); - } - } +const pLocate = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; - realStart() { - // No known way to make it work reliably on Windows - if (process.platform === 'win32') { - return; - } + const limit = pLimit(options.concurrency); - this.rl = readline.createInterface({ - input: process.stdin, - output: this.mutedStream - }); + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); - this.rl.on('SIGINT', () => { - if (process.listenerCount('SIGINT') === 0) { - process.emit('SIGINT'); - } else { - this.rl.close(); - process.kill(process.pid, 'SIGINT'); - } - }); - } + // Check the promises either serially or concurrently + const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); - realStop() { - if (process.platform === 'win32') { - return; + try { + await Promise.all(items.map(element => checkLimit(finder, element))); + } catch (error) { + if (error instanceof EndError) { + return error.value; } - this.rl.close(); - this.rl = undefined; + throw error; } -} - -let stdinDiscarder; - -class Ora { - constructor(options) { - if (!stdinDiscarder) { - stdinDiscarder = new StdinDiscarder(); - } - - if (typeof options === 'string') { - options = { - text: options - }; - } - - this.options = { - text: '', - color: 'cyan', - stream: process.stderr, - discardStdin: true, - ...options - }; +}; - this.spinner = this.options.spinner; +module.exports = pLocate; +// TODO: Remove this for the next major release +module.exports.default = pLocate; - this.color = this.options.color; - this.hideCursor = this.options.hideCursor !== false; - this.interval = this.options.interval || this.spinner.interval || 100; - this.stream = this.options.stream; - this.id = undefined; - this.isEnabled = typeof this.options.isEnabled === 'boolean' ? this.options.isEnabled : isInteractive({stream: this.stream}); - this.isSilent = typeof this.options.isSilent === 'boolean' ? this.options.isSilent : false; - // Set *after* `this.stream` - this.text = this.options.text; - this.prefixText = this.options.prefixText; - this.linesToClear = 0; - this.indent = this.options.indent; - this.discardStdin = this.options.discardStdin; - this.isDiscardingStdin = false; - } +/***/ }), - get indent() { - return this._indent; - } +/***/ 84944: +/***/ ((module) => { - set indent(indent = 0) { - if (!(indent >= 0 && Number.isInteger(indent))) { - throw new Error('The `indent` option must be an integer from 0 and up'); - } +"use strict"; - this._indent = indent; - } - _updateInterval(interval) { - if (interval !== undefined) { - this.interval = interval; - } - } +const pTry = (fn, ...arguments_) => new Promise(resolve => { + resolve(fn(...arguments_)); +}); - get spinner() { - return this._spinner; - } +module.exports = pTry; +// TODO: remove this in the next major version +module.exports.default = pTry; - set spinner(spinner) { - this.frameIndex = 0; - if (typeof spinner === 'object') { - if (spinner.frames === undefined) { - throw new Error('The given spinner must have a `frames` property'); - } +/***/ }), - this._spinner = spinner; - } else if (process.platform === 'win32') { - this._spinner = cliSpinners.line; - } else if (spinner === undefined) { - // Set default spinner - this._spinner = cliSpinners.dots; - } else if (cliSpinners[spinner]) { - this._spinner = cliSpinners[spinner]; - } else { - throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json for a full list.`); - } +/***/ 52518: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this._updateInterval(this._spinner.interval); - } +"use strict"; - get text() { - return this[TEXT]; - } +const errorEx = __nccwpck_require__(98361); +const fallback = __nccwpck_require__(36873); +const {default: LinesAndColumns} = __nccwpck_require__(99036); +const {codeFrameColumns} = __nccwpck_require__(36553); - get prefixText() { - return this[PREFIX_TEXT]; - } +const JSONError = errorEx('JSONError', { + fileName: errorEx.append('in %s'), + codeFrame: errorEx.append('\n\n%s\n') +}); - get isSpinning() { - return this.id !== undefined; +const parseJson = (string, reviver, filename) => { + if (typeof reviver === 'string') { + filename = reviver; + reviver = null; } - getFullPrefixText(prefixText = this[PREFIX_TEXT], postfix = ' ') { - if (typeof prefixText === 'string') { - return prefixText + postfix; + try { + try { + return JSON.parse(string, reviver); + } catch (error) { + fallback(string, reviver); + throw error; } + } catch (error) { + error.message = error.message.replace(/\n/g, ''); + const indexMatch = error.message.match(/in JSON at position (\d+) while parsing/); - if (typeof prefixText === 'function') { - return prefixText() + postfix; + const jsonError = new JSONError(error); + if (filename) { + jsonError.fileName = filename; } - return ''; - } - - updateLineCount() { - const columns = this.stream.columns || 80; - const fullPrefixText = this.getFullPrefixText(this.prefixText, '-'); - this.lineCount = stripAnsi(fullPrefixText + '--' + this[TEXT]).split('\n').reduce((count, line) => { - return count + Math.max(1, Math.ceil(wcwidth(line) / columns)); - }, 0); - } + if (indexMatch && indexMatch.length > 0) { + const lines = new LinesAndColumns(string); + const index = Number(indexMatch[1]); + const location = lines.locationForIndex(index); - set text(value) { - this[TEXT] = value; - this.updateLineCount(); - } + const codeFrame = codeFrameColumns( + string, + {start: {line: location.line + 1, column: location.column + 1}}, + {highlightCode: true} + ); - set prefixText(value) { - this[PREFIX_TEXT] = value; - this.updateLineCount(); - } + jsonError.codeFrame = codeFrame; + } - get isEnabled() { - return this._isEnabled && !this.isSilent; + throw jsonError; } +}; - set isEnabled(value) { - if (typeof value !== 'boolean') { - throw new TypeError('The `isEnabled` option must be a boolean'); - } +parseJson.JSONError = JSONError; - this._isEnabled = value; - } +module.exports = parseJson; - get isSilent() { - return this._isSilent; - } - set isSilent(value) { - if (typeof value !== 'boolean') { - throw new TypeError('The `isSilent` option must be a boolean'); - } +/***/ }), - this._isSilent = value; - } +/***/ 37637: +/***/ ((module) => { - frame() { - const {frames} = this.spinner; - let frame = frames[this.frameIndex]; +"use strict"; - if (this.color) { - frame = chalk[this.color](frame); - } - this.frameIndex = ++this.frameIndex % frames.length; - const fullPrefixText = (typeof this.prefixText === 'string' && this.prefixText !== '') ? this.prefixText + ' ' : ''; - const fullText = typeof this.text === 'string' ? ' ' + this.text : ''; +const pathKey = (options = {}) => { + const environment = options.env || process.env; + const platform = options.platform || process.platform; - return fullPrefixText + frame + fullText; + if (platform !== 'win32') { + return 'PATH'; } - clear() { - if (!this.isEnabled || !this.stream.isTTY) { - return this; - } + return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; +}; - for (let i = 0; i < this.linesToClear; i++) { - if (i > 0) { - this.stream.moveCursor(0, -1); - } +module.exports = pathKey; +// TODO: Remove this for the next major release +module.exports.default = pathKey; - this.stream.clearLine(); - this.stream.cursorTo(this.indent); - } - this.linesToClear = 0; +/***/ }), - return this; - } +/***/ 50731: +/***/ ((module) => { - render() { - if (this.isSilent) { - return this; - } +"use strict"; - this.clear(); - this.stream.write(this.frame()); - this.linesToClear = this.lineCount; - return this; - } +var isWindows = process.platform === 'win32'; - start(text) { - if (text) { - this.text = text; - } +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - if (this.isSilent) { - return this; - } +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; - if (!this.isEnabled) { - if (this.text) { - this.stream.write(`- ${this.text}\n`); - } +var win32 = {}; - return this; - } +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} - if (this.isSpinning) { - return this; - } +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; - if (this.hideCursor) { - cliCursor.hide(this.stream); - } - if (this.discardStdin && process.stdin.isTTY) { - this.isDiscardingStdin = true; - stdinDiscarder.start(); - } - this.render(); - this.id = setInterval(this.render.bind(this), this.interval); +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; - return this; - } - stop() { - if (!this.isEnabled) { - return this; - } +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} - clearInterval(this.id); - this.id = undefined; - this.frameIndex = 0; - this.clear(); - if (this.hideCursor) { - cliCursor.show(this.stream); - } - if (this.discardStdin && process.stdin.isTTY && this.isDiscardingStdin) { - stdinDiscarder.stop(); - this.isDiscardingStdin = false; - } +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; - return this; - } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; - succeed(text) { - return this.stopAndPersist({symbol: logSymbols.success, text}); - } - fail(text) { - return this.stopAndPersist({symbol: logSymbols.error, text}); - } +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; - warn(text) { - return this.stopAndPersist({symbol: logSymbols.warning, text}); - } +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; - info(text) { - return this.stopAndPersist({symbol: logSymbols.info, text}); - } - stopAndPersist(options = {}) { - if (this.isSilent) { - return this; - } +/***/ }), - const prefixText = options.prefixText || this.prefixText; - const text = options.text || this.text; - const fullText = (typeof text === 'string') ? ' ' + text : ''; +/***/ 71932: +/***/ ((module) => { - this.stop(); - this.stream.write(`${this.getFullPrefixText(prefixText, ' ')}${options.symbol || ' '}${fullText}\n`); +module.exports = Pend; - return this; - } +function Pend() { + this.pending = 0; + this.max = Infinity; + this.listeners = []; + this.waiting = []; + this.error = null; } -const oraFactory = function (options) { - return new Ora(options); +Pend.prototype.go = function(fn) { + if (this.pending < this.max) { + pendGo(this, fn); + } else { + this.waiting.push(fn); + } }; -module.exports = oraFactory; - -module.exports.promise = (action, options) => { - // eslint-disable-next-line promise/prefer-await-to-then - if (typeof action.then !== 'function') { - throw new TypeError('Parameter `action` must be a Promise'); - } +Pend.prototype.wait = function(cb) { + if (this.pending === 0) { + cb(this.error); + } else { + this.listeners.push(cb); + } +}; - const spinner = new Ora(options); - spinner.start(); +Pend.prototype.hold = function() { + return pendHold(this); +}; - (async () => { - try { - await action; - spinner.succeed(); - } catch (_) { - spinner.fail(); - } - })(); +function pendHold(self) { + self.pending += 1; + var called = false; + return onCb; + function onCb(err) { + if (called) throw new Error("callback called twice"); + called = true; + self.error = self.error || err; + self.pending -= 1; + if (self.waiting.length > 0 && self.pending < self.max) { + pendGo(self, self.waiting.shift()); + } else if (self.pending === 0) { + var listeners = self.listeners; + self.listeners = []; + listeners.forEach(cbListener); + } + } + function cbListener(listener) { + listener(self.error); + } +} - return spinner; -}; +function pendGo(self, fn) { + fn(pendHold(self)); +} /***/ }), -/***/ 87400: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ 32979: +/***/ ((module) => { "use strict"; -const restoreCursor = __webpack_require__(37463); - -let isHidden = false; - -exports.show = (writableStream = process.stderr) => { - if (!writableStream.isTTY) { - return; - } - - isHidden = false; - writableStream.write('\u001B[?25h'); -}; - -exports.hide = (writableStream = process.stderr) => { - if (!writableStream.isTTY) { - return; +module.exports = (url, opts) => { + if (typeof url !== 'string') { + throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``); } - restoreCursor(); - isHidden = true; - writableStream.write('\u001B[?25l'); -}; + url = url.trim(); + opts = Object.assign({https: false}, opts); -exports.toggle = (force, writableStream) => { - if (force !== undefined) { - isHidden = force; + if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { + return url; } - if (isHidden) { - exports.show(writableStream); - } else { - exports.hide(writableStream); - } + return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://'); }; /***/ }), -/***/ 37463: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -const onetime = __webpack_require__(81053); -const signalExit = __webpack_require__(22317); +/***/ 9154: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = onetime(() => { - signalExit(() => { - process.stderr.write('\u001B[?25h'); - }, {alwaysLast: true}); -}); +module.exports = __nccwpck_require__(91341); /***/ }), -/***/ 76348: -/***/ ((module) => { - -"use strict"; - - -class CancelError extends Error { - constructor(reason) { - super(reason || 'Promise was canceled'); - this.name = 'CancelError'; - } +/***/ 91341: +/***/ ((module, exports) => { - get isCanceled() { - return true; - } -} +/*! + * node-progress + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ -class PCancelable { - static fn(userFn) { - return (...args) => { - return new PCancelable((resolve, reject, onCancel) => { - args.push(onCancel); - userFn(...args).then(resolve, reject); - }); - }; - } +/** + * Expose `ProgressBar`. + */ - constructor(executor) { - this._cancelHandlers = []; - this._isPending = true; - this._isCanceled = false; - this._rejectOnCancel = true; +exports = module.exports = ProgressBar; - this._promise = new Promise((resolve, reject) => { - this._reject = reject; +/** + * Initialize a `ProgressBar` with the given `fmt` string and `options` or + * `total`. + * + * Options: + * + * - `curr` current completed index + * - `total` total number of ticks to complete + * - `width` the displayed width of the progress bar defaulting to total + * - `stream` the output stream defaulting to stderr + * - `head` head character defaulting to complete character + * - `complete` completion character defaulting to "=" + * - `incomplete` incomplete character defaulting to "-" + * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16 + * - `callback` optional function to call when the progress bar completes + * - `clear` will clear the progress bar upon termination + * + * Tokens: + * + * - `:bar` the progress bar itself + * - `:current` current tick number + * - `:total` total ticks + * - `:elapsed` time elapsed in seconds + * - `:percent` completion percentage + * - `:eta` eta in seconds + * - `:rate` rate of ticks per second + * + * @param {string} fmt + * @param {object|number} options or total + * @api public + */ - const onResolve = value => { - this._isPending = false; - resolve(value); - }; +function ProgressBar(fmt, options) { + this.stream = options.stream || process.stderr; - const onReject = error => { - this._isPending = false; - reject(error); - }; + if (typeof(options) == 'number') { + var total = options; + options = {}; + options.total = total; + } else { + options = options || {}; + if ('string' != typeof fmt) throw new Error('format required'); + if ('number' != typeof options.total) throw new Error('total required'); + } - const onCancel = handler => { - this._cancelHandlers.push(handler); - }; + this.fmt = fmt; + this.curr = options.curr || 0; + this.total = options.total; + this.width = options.width || this.total; + this.clear = options.clear + this.chars = { + complete : options.complete || '=', + incomplete : options.incomplete || '-', + head : options.head || (options.complete || '=') + }; + this.renderThrottle = options.renderThrottle !== 0 ? (options.renderThrottle || 16) : 0; + this.lastRender = -Infinity; + this.callback = options.callback || function () {}; + this.tokens = {}; + this.lastDraw = ''; +} - Object.defineProperties(onCancel, { - shouldReject: { - get: () => this._rejectOnCancel, - set: bool => { - this._rejectOnCancel = bool; - } - } - }); +/** + * "tick" the progress bar with optional `len` and optional `tokens`. + * + * @param {number|object} len or tokens + * @param {object} tokens + * @api public + */ - return executor(onResolve, onReject, onCancel); - }); - } +ProgressBar.prototype.tick = function(len, tokens){ + if (len !== 0) + len = len || 1; - then(onFulfilled, onRejected) { - return this._promise.then(onFulfilled, onRejected); - } + // swap tokens + if ('object' == typeof len) tokens = len, len = 1; + if (tokens) this.tokens = tokens; - catch(onRejected) { - return this._promise.catch(onRejected); - } + // start time for eta + if (0 == this.curr) this.start = new Date; - finally(onFinally) { - return this._promise.finally(onFinally); - } + this.curr += len - cancel(reason) { - if (!this._isPending || this._isCanceled) { - return; - } + // try to render + this.render(); - if (this._cancelHandlers.length > 0) { - try { - for (const handler of this._cancelHandlers) { - handler(); - } - } catch (error) { - this._reject(error); - } - } + // progress complete + if (this.curr >= this.total) { + this.render(undefined, true); + this.complete = true; + this.terminate(); + this.callback(this); + return; + } +}; - this._isCanceled = true; - if (this._rejectOnCancel) { - this._reject(new CancelError(reason)); - } - } +/** + * Method to render the progress bar with optional `tokens` to place in the + * progress bar's `fmt` field. + * + * @param {object} tokens + * @api public + */ - get isCanceled() { - return this._isCanceled; - } -} +ProgressBar.prototype.render = function (tokens, force) { + force = force !== undefined ? force : false; + if (tokens) this.tokens = tokens; -Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); + if (!this.stream.isTTY) return; -module.exports = PCancelable; -module.exports.default = PCancelable; + var now = Date.now(); + var delta = now - this.lastRender; + if (!force && (delta < this.renderThrottle)) { + return; + } else { + this.lastRender = now; + } -module.exports.CancelError = CancelError; + var ratio = this.curr / this.total; + ratio = Math.min(Math.max(ratio, 0), 1); + var percent = Math.floor(ratio * 100); + var incomplete, complete, completeLength; + var elapsed = new Date - this.start; + var eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1); + var rate = this.curr / (elapsed / 1000); -/***/ }), + /* populate the bar template with percentages and timestamps */ + var str = this.fmt + .replace(':current', this.curr) + .replace(':total', this.total) + .replace(':elapsed', isNaN(elapsed) ? '0.0' : (elapsed / 1000).toFixed(1)) + .replace(':eta', (isNaN(eta) || !isFinite(eta)) ? '0.0' : (eta / 1000) + .toFixed(1)) + .replace(':percent', percent.toFixed(0) + '%') + .replace(':rate', Math.round(rate)); -/***/ 18884: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + /* compute the available space (non-zero) for the bar */ + var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length); + if(availableSpace && process.platform === 'win32'){ + availableSpace = availableSpace - 1; + } -"use strict"; + var width = Math.min(this.width, availableSpace); -const pTry = __webpack_require__(84944); + /* TODO: the following assumes the user has one ':bar' token */ + completeLength = Math.round(width * ratio); + complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete); + incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete); -const pLimit = concurrency => { - if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { - return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); - } + /* add head to the complete string */ + if(completeLength > 0) + complete = complete.slice(0, -1) + this.chars.head; - const queue = []; - let activeCount = 0; + /* fill in the actual progress bar */ + str = str.replace(':bar', complete + incomplete); - const next = () => { - activeCount--; + /* replace the extra tokens */ + if (this.tokens) for (var key in this.tokens) str = str.replace(':' + key, this.tokens[key]); - if (queue.length > 0) { - queue.shift()(); - } - }; + if (this.lastDraw !== str) { + this.stream.cursorTo(0); + this.stream.write(str); + this.stream.clearLine(1); + this.lastDraw = str; + } +}; - const run = (fn, resolve, ...args) => { - activeCount++; +/** + * "update" the progress bar to represent an exact percentage. + * The ratio (between 0 and 1) specified will be multiplied by `total` and + * floored, representing the closest available "tick." For example, if a + * progress bar has a length of 3 and `update(0.5)` is called, the progress + * will be set to 1. + * + * A ratio of 0.5 will attempt to set the progress to halfway. + * + * @param {number} ratio The ratio (between 0 and 1 inclusive) to set the + * overall completion to. + * @api public + */ - const result = pTry(fn, ...args); +ProgressBar.prototype.update = function (ratio, tokens) { + var goal = Math.floor(ratio * this.total); + var delta = goal - this.curr; - resolve(result); + this.tick(delta, tokens); +}; - result.then(next, next); - }; +/** + * "interrupt" the progress bar and write a message above it. + * @param {string} message The message to write. + * @api public + */ - const enqueue = (fn, resolve, ...args) => { - if (activeCount < concurrency) { - run(fn, resolve, ...args); - } else { - queue.push(run.bind(null, fn, resolve, ...args)); - } - }; +ProgressBar.prototype.interrupt = function (message) { + // clear the current line + this.stream.clearLine(); + // move the cursor to the start of the line + this.stream.cursorTo(0); + // write the message text + this.stream.write(message); + // terminate the line after writing the message + this.stream.write('\n'); + // re-display the progress bar with its lastDraw + this.stream.write(this.lastDraw); +}; - const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.length - }, - clearQueue: { - value: () => { - queue.length = 0; - } - } - }); +/** + * Terminates a progress bar. + * + * @api public + */ - return generator; +ProgressBar.prototype.terminate = function () { + if (this.clear) { + if (this.stream.clearLine) { + this.stream.clearLine(); + this.stream.cursorTo(0); + } + } else { + this.stream.write('\n'); + } }; -module.exports = pLimit; -module.exports.default = pLimit; - /***/ }), -/***/ 60364: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 92123: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pLimit = __webpack_require__(18884); - -class EndError extends Error { - constructor(value) { - super(); - this.value = value; - } -} -// The input can also be a promise, so we await it -const testElement = async (element, tester) => tester(await element); +const lockfile = __nccwpck_require__(40156); +const { toPromise, toSync, toSyncOptions } = __nccwpck_require__(77950); -// The input can also be a promise, so we `Promise.all()` them both -const finder = async element => { - const values = await Promise.all(element); - if (values[1] === true) { - throw new EndError(values[0]); - } +async function lock(file, options) { + const release = await toPromise(lockfile.lock)(file, options); - return false; -}; + return toPromise(release); +} -const pLocate = async (iterable, tester, options) => { - options = { - concurrency: Infinity, - preserveOrder: true, - ...options - }; +function lockSync(file, options) { + const release = toSync(lockfile.lock)(file, toSyncOptions(options)); - const limit = pLimit(options.concurrency); + return toSync(release); +} - // Start all the promises concurrently with optional limit - const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); +function unlock(file, options) { + return toPromise(lockfile.unlock)(file, options); +} - // Check the promises either serially or concurrently - const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); +function unlockSync(file, options) { + return toSync(lockfile.unlock)(file, toSyncOptions(options)); +} - try { - await Promise.all(items.map(element => checkLimit(finder, element))); - } catch (error) { - if (error instanceof EndError) { - return error.value; - } +function check(file, options) { + return toPromise(lockfile.check)(file, options); +} - throw error; - } -}; +function checkSync(file, options) { + return toSync(lockfile.check)(file, toSyncOptions(options)); +} -module.exports = pLocate; -// TODO: Remove this for the next major release -module.exports.default = pLocate; +module.exports = lock; +module.exports.lock = lock; +module.exports.unlock = unlock; +module.exports.lockSync = lockSync; +module.exports.unlockSync = unlockSync; +module.exports.check = check; +module.exports.checkSync = checkSync; /***/ }), -/***/ 84944: -/***/ ((module) => { +/***/ 77950: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const pTry = (fn, ...arguments_) => new Promise(resolve => { - resolve(fn(...arguments_)); -}); - -module.exports = pTry; -// TODO: remove this in the next major version -module.exports.default = pTry; - +const fs = __nccwpck_require__(82161); -/***/ }), +function createSyncFs(fs) { + const methods = ['mkdir', 'realpath', 'stat', 'rmdir', 'utimes']; + const newFs = { ...fs }; -/***/ 43403: -/***/ ((module) => { + methods.forEach((method) => { + newFs[method] = (...args) => { + const callback = args.pop(); + let ret; -"use strict"; + try { + ret = fs[`${method}Sync`](...args); + } catch (err) { + return callback(err); + } + callback(null, ret); + }; + }); -/** - * Parse the content of a passwd file into a list of user objects. - * This function ignores blank lines and comments. - * - * ```js - * // assuming '/etc/passwd' contains: - * // doowb:*:123:123:Brian Woodward:/Users/doowb:/bin/bash - * console.log(parse(fs.readFileSync('/etc/passwd', 'utf8'))); - * - * //=> [ - * //=> { - * //=> username: 'doowb', - * //=> password: '*', - * //=> uid: '123', - * //=> gid: '123', - * //=> gecos: 'Brian Woodward', - * //=> homedir: '/Users/doowb', - * //=> shell: '/bin/bash' - * //=> } - * //=> ] - * ``` - * @param {String} `content` Content of a passwd file to parse. - * @return {Array} Array of user objects parsed from the content. - * @api public - */ + return newFs; +} -module.exports = function(content) { - if (typeof content !== 'string') { - throw new Error('expected a string'); - } - return content - .split('\n') - .map(user) - .filter(Boolean); -}; +// ---------------------------------------------------------- -function user(line, i) { - if (!line || !line.length || line.charAt(0) === '#') { - return null; - } +function toPromise(method) { + return (...args) => new Promise((resolve, reject) => { + args.push((err, result) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); - // see https://en.wikipedia.org/wiki/Passwd for field descriptions - var fields = line.split(':'); - return { - username: fields[0], - password: fields[1], - uid: fields[2], - gid: fields[3], - // see https://en.wikipedia.org/wiki/Gecos_field for GECOS field descriptions - gecos: fields[4], - homedir: fields[5], - shell: fields[6] - }; + method(...args); + }); } +function toSync(method) { + return (...args) => { + let err; + let result; -/***/ }), + args.push((_err, _result) => { + err = _err; + result = _result; + }); -/***/ 27255: -/***/ ((module) => { + method(...args); -/*! - * pascalcase - * - * Copyright (c) 2015-present, Jon ("Schlink") Schlinkert. - * Licensed under the MIT License. - */ + if (err) { + throw err; + } -const titlecase = input => input[0].toLocaleUpperCase() + input.slice(1); + return result; + }; +} -module.exports = value => { - if (value === null || value === void 0) return ''; - if (typeof value.toString !== 'function') return ''; +function toSyncOptions(options) { + // Shallow clone options because we are oging to mutate them + options = { ...options }; - let input = value.toString().trim(); - if (input === '') return ''; - if (input.length === 1) return input.toLocaleUpperCase(); + // Transform fs to use the sync methods instead + options.fs = createSyncFs(options.fs || fs); - let match = input.match(/[a-zA-Z0-9]+/g); - if (match) { - return match.map(m => titlecase(m)).join(''); - } + // Retries are not allowed because it requires the flow to be sync + if ( + (typeof options.retries === 'number' && options.retries > 0) || + (options.retries && typeof options.retries.retries === 'number' && options.retries.retries > 0) + ) { + throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' }); + } - return input; + return options; +} + +module.exports = { + toPromise, + toSync, + toSyncOptions, }; /***/ }), -/***/ 36540: -/***/ ((module) => { +/***/ 40156: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -function posix(path) { - return path.charAt(0) === '/'; +const path = __nccwpck_require__(85622); +const fs = __nccwpck_require__(82161); +const retry = __nccwpck_require__(59454); +const onExit = __nccwpck_require__(22317); +const mtimePrecision = __nccwpck_require__(79200); + +const locks = {}; + +function getLockFile(file, options) { + return options.lockfilePath || `${file}.lock`; } -function win32(path) { - // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = Boolean(device && device.charAt(1) !== ':'); +function resolveCanonicalPath(file, options, callback) { + if (!options.realpath) { + return callback(null, path.resolve(file)); + } - // UNC paths are always absolute - return Boolean(result[2] || isUnc); + // Use realpath to resolve symlinks + // It also resolves relative paths + options.fs.realpath(file, callback); } -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; +function acquireLock(file, options, callback) { + const lockfilePath = getLockFile(file, options); + // Use mkdir to create the lockfile (atomic operation) + options.fs.mkdir(lockfilePath, (err) => { + if (!err) { + // At this point, we acquired the lock! + // Probe the mtime precision + return mtimePrecision.probe(lockfilePath, options.fs, (err, mtime, mtimePrecision) => { + // If it failed, try to remove the lock.. + /* istanbul ignore if */ + if (err) { + options.fs.rmdir(lockfilePath, () => {}); -/***/ }), + return callback(err); + } -/***/ 50731: -/***/ ((module) => { + callback(null, mtime, mtimePrecision); + }); + } -"use strict"; + // If error is not EEXIST then some other error occurred while locking + if (err.code !== 'EEXIST') { + return callback(err); + } + // Otherwise, check if lock is stale by analyzing the file mtime + if (options.stale <= 0) { + return callback(Object.assign(new Error('Lock file is already being held'), { code: 'ELOCKED', file })); + } -var isWindows = process.platform === 'win32'; + options.fs.stat(lockfilePath, (err, stat) => { + if (err) { + // Retry if the lockfile has been removed (meanwhile) + // Skip stale check to avoid recursiveness + if (err.code === 'ENOENT') { + return acquireLock(file, { ...options, stale: 0 }, callback); + } -// Regex to split a windows path into three parts: [*, device, slash, -// tail] windows-only -var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + return callback(err); + } -// Regex to split the tail part of the above into [*, dir, basename, ext] -var splitTailRe = - /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + if (!isLockStale(stat, options)) { + return callback(Object.assign(new Error('Lock file is already being held'), { code: 'ELOCKED', file })); + } -var win32 = {}; + // If it's stale, remove it and try again! + // Skip stale check to avoid recursiveness + removeLock(file, options, (err) => { + if (err) { + return callback(err); + } -// Function to split a filename into [root, dir, basename, ext] -function win32SplitPath(filename) { - // Separate device+slash from tail - var result = splitDeviceRe.exec(filename), - device = (result[1] || '') + (result[2] || ''), - tail = result[3] || ''; - // Split the tail into dir, basename and extension - var result2 = splitTailRe.exec(tail), - dir = result2[1], - basename = result2[2], - ext = result2[3]; - return [device, dir, basename, ext]; + acquireLock(file, { ...options, stale: 0 }, callback); + }); + }); + }); } -win32.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 4) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; +function isLockStale(stat, options) { + return stat.mtime.getTime() < Date.now() - options.stale; +} +function removeLock(file, options, callback) { + // Remove lockfile, ignoring ENOENT errors + options.fs.rmdir(getLockFile(file, options), (err) => { + if (err && err.code !== 'ENOENT') { + return callback(err); + } + callback(); + }); +} -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var posix = {}; +function updateLock(file, options) { + const lock = locks[file]; + // Just for safety, should never happen + /* istanbul ignore if */ + if (lock.updateTimeout) { + return; + } -function posixSplitPath(filename) { - return splitPathRe.exec(filename).slice(1); -} + lock.updateDelay = lock.updateDelay || options.update; + lock.updateTimeout = setTimeout(() => { + lock.updateTimeout = null; + // Stat the file to check if mtime is still ours + // If it is, we can still recover from a system sleep or a busy event loop + options.fs.stat(lock.lockfilePath, (err, stat) => { + const isOverThreshold = lock.lastUpdate + options.stale < Date.now(); -posix.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 4) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - allParts[1] = allParts[1] || ''; - allParts[2] = allParts[2] || ''; - allParts[3] = allParts[3] || ''; + // If it failed to update the lockfile, keep trying unless + // the lockfile was deleted or we are over the threshold + if (err) { + if (err.code === 'ENOENT' || isOverThreshold) { + return setLockAsCompromised(file, lock, Object.assign(err, { code: 'ECOMPROMISED' })); + } - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; + lock.updateDelay = 1000; + return updateLock(file, options); + } -if (isWindows) - module.exports = win32.parse; -else /* posix */ - module.exports = posix.parse; + const isMtimeOurs = lock.mtime.getTime() === stat.mtime.getTime(); -module.exports.posix = posix.parse; -module.exports.win32 = win32.parse; + if (!isMtimeOurs) { + return setLockAsCompromised( + file, + lock, + Object.assign( + new Error('Unable to update lock within the stale threshold'), + { code: 'ECOMPROMISED' } + )); + } + const mtime = mtimePrecision.getMtime(lock.mtimePrecision); -/***/ }), + options.fs.utimes(lock.lockfilePath, mtime, mtime, (err) => { + const isOverThreshold = lock.lastUpdate + options.stale < Date.now(); -/***/ 71932: -/***/ ((module) => { + // Ignore if the lock was released + if (lock.released) { + return; + } -module.exports = Pend; + // If it failed to update the lockfile, keep trying unless + // the lockfile was deleted or we are over the threshold + if (err) { + if (err.code === 'ENOENT' || isOverThreshold) { + return setLockAsCompromised(file, lock, Object.assign(err, { code: 'ECOMPROMISED' })); + } -function Pend() { - this.pending = 0; - this.max = Infinity; - this.listeners = []; - this.waiting = []; - this.error = null; -} + lock.updateDelay = 1000; -Pend.prototype.go = function(fn) { - if (this.pending < this.max) { - pendGo(this, fn); - } else { - this.waiting.push(fn); - } -}; + return updateLock(file, options); + } -Pend.prototype.wait = function(cb) { - if (this.pending === 0) { - cb(this.error); - } else { - this.listeners.push(cb); - } -}; + // All ok, keep updating.. + lock.mtime = mtime; + lock.lastUpdate = Date.now(); + lock.updateDelay = null; + updateLock(file, options); + }); + }); + }, lock.updateDelay); -Pend.prototype.hold = function() { - return pendHold(this); -}; + // Unref the timer so that the nodejs process can exit freely + // This is safe because all acquired locks will be automatically released + // on process exit -function pendHold(self) { - self.pending += 1; - var called = false; - return onCb; - function onCb(err) { - if (called) throw new Error("callback called twice"); - called = true; - self.error = self.error || err; - self.pending -= 1; - if (self.waiting.length > 0 && self.pending < self.max) { - pendGo(self, self.waiting.shift()); - } else if (self.pending === 0) { - var listeners = self.listeners; - self.listeners = []; - listeners.forEach(cbListener); + // We first check that `lock.updateTimeout.unref` exists because some users + // may be using this module outside of NodeJS (e.g., in an electron app), + // and in those cases `setTimeout` return an integer. + /* istanbul ignore else */ + if (lock.updateTimeout.unref) { + lock.updateTimeout.unref(); } - } - function cbListener(listener) { - listener(self.error); - } } -function pendGo(self, fn) { - fn(pendHold(self)); +function setLockAsCompromised(file, lock, err) { + // Signal the lock has been released + lock.released = true; + + // Cancel lock mtime update + // Just for safety, at this point updateTimeout should be null + /* istanbul ignore if */ + if (lock.updateTimeout) { + clearTimeout(lock.updateTimeout); + } + + if (locks[file] === lock) { + delete locks[file]; + } + + lock.options.onCompromised(err); } +// ---------------------------------------------------------- -/***/ }), +function lock(file, options, callback) { + /* istanbul ignore next */ + options = { + stale: 10000, + update: null, + realpath: true, + retries: 0, + fs, + onCompromised: (err) => { throw err; }, + ...options, + }; -/***/ 5669: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + options.retries = options.retries || 0; + options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; + options.stale = Math.max(options.stale || 0, 2000); + options.update = options.update == null ? options.stale / 2 : options.update || 0; + options.update = Math.max(Math.min(options.update, options.stale / 2), 1000); -"use strict"; + // Resolve to a canonical file path + resolveCanonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + // Attempt to acquire the lock + const operation = retry.operation(options.retries); -module.exports = __webpack_require__(47188); + operation.attempt(() => { + acquireLock(file, options, (err, mtime, mtimePrecision) => { + if (operation.retry(err)) { + return; + } + if (err) { + return callback(operation.mainError()); + } -/***/ }), + // We now own the lock + const lock = locks[file] = { + lockfilePath: getLockFile(file, options), + mtime, + mtimePrecision, + options, + lastUpdate: Date.now(), + }; -/***/ 1259: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // We must keep the lock fresh to avoid staleness + updateLock(file, options); -"use strict"; + callback(null, (releasedCallback) => { + if (lock.released) { + return releasedCallback && + releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' })); + } + // Not necessary to use realpath twice when unlocking + unlock(file, { ...options, realpath: false }, releasedCallback); + }); + }); + }); + }); +} -const path = __webpack_require__(85622); -const WIN_SLASH = '\\\\/'; -const WIN_NO_SLASH = `[^${WIN_SLASH}]`; +function unlock(file, options, callback) { + options = { + fs, + realpath: true, + ...options, + }; -/** - * Posix glob regex - */ + // Resolve to a canonical file path + resolveCanonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } -const DOT_LITERAL = '\\.'; -const PLUS_LITERAL = '\\+'; -const QMARK_LITERAL = '\\?'; -const SLASH_LITERAL = '\\/'; -const ONE_CHAR = '(?=.)'; -const QMARK = '[^/]'; -const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; -const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; -const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; -const NO_DOT = `(?!${DOT_LITERAL})`; -const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; -const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; -const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; -const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; -const STAR = `${QMARK}*?`; + // Skip if the lock is not acquired + const lock = locks[file]; -const POSIX_CHARS = { - DOT_LITERAL, - PLUS_LITERAL, - QMARK_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - QMARK, - END_ANCHOR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK_NO_DOT, - STAR, - START_ANCHOR -}; + if (!lock) { + return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' })); + } -/** - * Windows glob regex - */ + lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update + lock.released = true; // Signal the lock has been released + delete locks[file]; // Delete from locks -const WINDOWS_CHARS = { - ...POSIX_CHARS, + removeLock(file, options, callback); + }); +} - SLASH_LITERAL: `[${WIN_SLASH}]`, - QMARK: WIN_NO_SLASH, - STAR: `${WIN_NO_SLASH}*?`, - DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, - NO_DOT: `(?!${DOT_LITERAL})`, - NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, - NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - QMARK_NO_DOT: `[^.${WIN_SLASH}]`, - START_ANCHOR: `(?:^|[${WIN_SLASH}])`, - END_ANCHOR: `(?:[${WIN_SLASH}]|$)` -}; +function check(file, options, callback) { + options = { + stale: 10000, + realpath: true, + fs, + ...options, + }; -/** - * POSIX Bracket Regex - */ + options.stale = Math.max(options.stale || 0, 2000); -const POSIX_REGEX_SOURCE = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' -}; + // Resolve to a canonical file path + resolveCanonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } -module.exports = { - MAX_LENGTH: 1024 * 64, - POSIX_REGEX_SOURCE, + // Check if lockfile exists + options.fs.stat(getLockFile(file, options), (err, stat) => { + if (err) { + // If does not exist, file is not locked. Otherwise, callback with error + return err.code === 'ENOENT' ? callback(null, false) : callback(err); + } - // regular expressions - REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, - REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, - REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, - REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, - REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, - REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + // Otherwise, check if lock is stale by analyzing the file mtime + return callback(null, !isLockStale(stat, options)); + }); + }); +} - // Replace globs with equivalent patterns to reduce parsing time. - REPLACEMENTS: { - '***': '*', - '**/**': '**', - '**/**/**': '**' - }, +function getLocks() { + return locks; +} - // Digits - CHAR_0: 48, /* 0 */ - CHAR_9: 57, /* 9 */ +// Remove acquired locks on exit +/* istanbul ignore next */ +onExit(() => { + for (const file in locks) { + const options = locks[file].options; - // Alphabet chars. - CHAR_UPPERCASE_A: 65, /* A */ - CHAR_LOWERCASE_A: 97, /* a */ - CHAR_UPPERCASE_Z: 90, /* Z */ - CHAR_LOWERCASE_Z: 122, /* z */ + try { options.fs.rmdirSync(getLockFile(file, options)); } catch (e) { /* Empty */ } + } +}); - CHAR_LEFT_PARENTHESES: 40, /* ( */ - CHAR_RIGHT_PARENTHESES: 41, /* ) */ +module.exports.lock = lock; +module.exports.unlock = unlock; +module.exports.check = check; +module.exports.getLocks = getLocks; - CHAR_ASTERISK: 42, /* * */ - // Non-alphabetic chars. - CHAR_AMPERSAND: 38, /* & */ - CHAR_AT: 64, /* @ */ - CHAR_BACKWARD_SLASH: 92, /* \ */ - CHAR_CARRIAGE_RETURN: 13, /* \r */ - CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ - CHAR_COLON: 58, /* : */ - CHAR_COMMA: 44, /* , */ - CHAR_DOT: 46, /* . */ - CHAR_DOUBLE_QUOTE: 34, /* " */ - CHAR_EQUAL: 61, /* = */ - CHAR_EXCLAMATION_MARK: 33, /* ! */ - CHAR_FORM_FEED: 12, /* \f */ - CHAR_FORWARD_SLASH: 47, /* / */ - CHAR_GRAVE_ACCENT: 96, /* ` */ - CHAR_HASH: 35, /* # */ - CHAR_HYPHEN_MINUS: 45, /* - */ - CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ - CHAR_LEFT_CURLY_BRACE: 123, /* { */ - CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ - CHAR_LINE_FEED: 10, /* \n */ - CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ - CHAR_PERCENT: 37, /* % */ - CHAR_PLUS: 43, /* + */ - CHAR_QUESTION_MARK: 63, /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ - CHAR_RIGHT_CURLY_BRACE: 125, /* } */ - CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ - CHAR_SEMICOLON: 59, /* ; */ - CHAR_SINGLE_QUOTE: 39, /* ' */ - CHAR_SPACE: 32, /* */ - CHAR_TAB: 9, /* \t */ - CHAR_UNDERSCORE: 95, /* _ */ - CHAR_VERTICAL_LINE: 124, /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ +/***/ }), - SEP: path.sep, +/***/ 79200: +/***/ ((module) => { - /** - * Create EXTGLOB_CHARS - */ +"use strict"; - extglobChars(chars) { - return { - '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, - '?': { type: 'qmark', open: '(?:', close: ')?' }, - '+': { type: 'plus', open: '(?:', close: ')+' }, - '*': { type: 'star', open: '(?:', close: ')*' }, - '@': { type: 'at', open: '(?:', close: ')' } - }; - }, - /** - * Create GLOB_CHARS - */ +const cacheSymbol = Symbol(); - globChars(win32) { - return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; - } -}; +function probe(file, fs, callback) { + const cachedPrecision = fs[cacheSymbol]; + if (cachedPrecision) { + return fs.stat(file, (err, stat) => { + /* istanbul ignore if */ + if (err) { + return callback(err); + } -/***/ }), + callback(null, stat.mtime, cachedPrecision); + }); + } -/***/ 3155: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + // Set mtime by ceiling Date.now() to seconds + 5ms so that it's "not on the second" + const mtime = new Date((Math.ceil(Date.now() / 1000) * 1000) + 5); -"use strict"; + fs.utimes(file, mtime, mtime, (err) => { + /* istanbul ignore if */ + if (err) { + return callback(err); + } + fs.stat(file, (err, stat) => { + /* istanbul ignore if */ + if (err) { + return callback(err); + } -const constants = __webpack_require__(1259); -const utils = __webpack_require__(86444); + const precision = stat.mtime.getTime() % 1000 === 0 ? 's' : 'ms'; -/** - * Constants - */ + // Cache the precision in a non-enumerable way + Object.defineProperty(fs, cacheSymbol, { value: precision }); -const { - MAX_LENGTH, - POSIX_REGEX_SOURCE, - REGEX_NON_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_BACKREF, - REPLACEMENTS -} = constants; + callback(null, stat.mtime, precision); + }); + }); +} -/** - * Helpers - */ +function getMtime(precision) { + let now = Date.now(); -const expandRange = (args, options) => { - if (typeof options.expandRange === 'function') { - return options.expandRange(...args, options); - } + if (precision === 's') { + now = Math.ceil(now / 1000) * 1000; + } - args.sort(); - const value = `[${args.join('-')}]`; + return new Date(now); +} - try { - /* eslint-disable-next-line no-new */ - new RegExp(value); - } catch (ex) { - return args.map(v => utils.escapeRegex(v)).join('..'); - } +module.exports.probe = probe; +module.exports.getMtime = getMtime; - return value; -}; -/** - * Create the message for a syntax error - */ +/***/ }), -const syntaxError = (type, char) => { - return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; -}; +/***/ 98051: +/***/ ((module) => { -/** - * Parse the given input string. - * @param {String} input - * @param {Object} options - * @return {Object} - */ -const parse = (input, options) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } +module.exports = ProtoList - input = REPLACEMENTS[input] || input; +function setProto(obj, proto) { + if (typeof Object.setPrototypeOf === "function") + return Object.setPrototypeOf(obj, proto) + else + obj.__proto__ = proto +} - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; +function ProtoList () { + this.list = [] + var root = null + Object.defineProperty(this, 'root', { + get: function () { return root }, + set: function (r) { + root = r + if (this.list.length) { + setProto(this.list[this.list.length - 1], r) + } + }, + enumerable: true, + configurable: true + }) +} - let len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); +ProtoList.prototype = + { get length () { return this.list.length } + , get keys () { + var k = [] + for (var i in this.list[0]) k.push(i) + return k + } + , get snapshot () { + var o = {} + this.keys.forEach(function (k) { o[k] = this.get(k) }, this) + return o + } + , get store () { + return this.list[0] + } + , push : function (obj) { + if (typeof obj !== "object") obj = {valueOf:obj} + if (this.list.length >= 1) { + setProto(this.list[this.list.length - 1], obj) + } + setProto(obj, this.root) + return this.list.push(obj) + } + , pop : function () { + if (this.list.length >= 2) { + setProto(this.list[this.list.length - 2], this.root) + } + return this.list.pop() + } + , unshift : function (obj) { + setProto(obj, this.list[0] || this.root) + return this.list.unshift(obj) + } + , shift : function () { + if (this.list.length === 1) { + setProto(this.list[0], this.root) + } + return this.list.shift() + } + , get : function (key) { + return this.list[0][key] + } + , set : function (key, val, save) { + if (!this.length) this.push({}) + if (save && this.list[0].hasOwnProperty(key)) this.push({}) + return this.list[0][key] = val + } + , forEach : function (fn, thisp) { + for (var key in this.list[0]) fn.call(thisp, key, this.list[0][key]) + } + , slice : function () { + return this.list.slice.apply(this.list, arguments) + } + , splice : function () { + // handle injections + var ret = this.list.splice.apply(this.list, arguments) + for (var i = 0, l = this.list.length; i < l; i++) { + setProto(this.list[i], this.list[i + 1] || this.root) + } + return ret + } } - const bos = { type: 'bos', value: '', output: opts.prepend || '' }; - const tokens = [bos]; - const capture = opts.capture ? '' : '?:'; - const win32 = utils.isWindows(options); +/***/ }), - // create constants based on platform, for windows or posix - const PLATFORM_CHARS = constants.globChars(win32); - const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); +/***/ 20113: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const { - DOT_LITERAL, - PLUS_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK, - QMARK_NO_DOT, - STAR, - START_ANCHOR - } = PLATFORM_CHARS; +var once = __nccwpck_require__(96754) +var eos = __nccwpck_require__(11745) +var fs = __nccwpck_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes - const globstar = (opts) => { - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; +var noop = function () {} +var ancient = /^v?\.0/.test(process.version) - const nodot = opts.dot ? '' : NO_DOT; - const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; - let star = opts.bash === true ? globstar(opts) : STAR; +var isFn = function (fn) { + return typeof fn === 'function' +} - if (opts.capture) { - star = `(${star})`; - } +var isFS = function (stream) { + if (!ancient) return false // newer node version do not need to care about fs is a special way + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +} - // minimatch options support - if (typeof opts.noext === 'boolean') { - opts.noextglob = opts.noext; - } +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) +} - const state = { - input, - index: -1, - start: 0, - dot: opts.dot === true, - consumed: '', - output: '', - prefix: '', - backtrack: false, - negated: false, - brackets: 0, - braces: 0, - parens: 0, - quotes: 0, - globstar: false, - tokens - }; +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) - input = utils.removePrefix(input, state); - len = input.length; + var closed = false + stream.on('close', function () { + closed = true + }) - const extglobs = []; - const braces = []; - const stack = []; - let prev = bos; - let value; + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) - /** - * Tokenizing helpers - */ + var destroyed = false + return function (err) { + if (closed) return + if (destroyed) return + destroyed = true - const eos = () => state.index === len - 1; - const peek = state.peek = (n = 1) => input[state.index + n]; - const advance = state.advance = () => input[++state.index]; - const remaining = () => input.slice(state.index + 1); - const consume = (value = '', num = 0) => { - state.consumed += value; - state.index += num; - }; - const append = token => { - state.output += token.output != null ? token.output : token.value; - consume(token.value); - }; + if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks + if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - const negate = () => { - let count = 1; + if (isFn(stream.destroy)) return stream.destroy() - while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { - advance(); - state.start++; - count++; - } + callback(err || new Error('stream was destroyed')) + } +} - if (count % 2 === 0) { - return false; - } +var call = function (fn) { + fn() +} - state.negated = true; - state.start++; - return true; - }; +var pipe = function (from, to) { + return from.pipe(to) +} - const increment = type => { - state[type]++; - stack.push(type); - }; +var pump = function () { + var streams = Array.prototype.slice.call(arguments) + var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop - const decrement = type => { - state[type]--; - stack.pop(); - }; + if (Array.isArray(streams[0])) streams = streams[0] + if (streams.length < 2) throw new Error('pump requires two streams per minimum') - /** - * Push tokens onto the tokens array. This helper speeds up - * tokenizing by 1) helping us avoid backtracking as much as possible, - * and 2) helping us avoid creating extra tokens when consecutive - * characters are plain text. This improves performance and simplifies - * lookbehinds. - */ + var error + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1 + var writing = i > 0 + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err + if (err) destroys.forEach(call) + if (reading) return + destroys.forEach(call) + callback(error) + }) + }) - const push = tok => { - if (prev.type === 'globstar') { - const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); - const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + return streams.reduce(pipe) +} - if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { - state.output = state.output.slice(0, -prev.output.length); - prev.type = 'star'; - prev.value = '*'; - prev.output = star; - state.output += prev.output; - } - } +module.exports = pump - if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) { - extglobs[extglobs.length - 1].inner += tok.value; - } - if (tok.value || tok.output) append(tok); - if (prev && prev.type === 'text' && tok.type === 'text') { - prev.value += tok.value; - prev.output = (prev.output || '') + tok.value; - return; - } +/***/ }), - tok.prev = prev; - tokens.push(tok); - prev = tok; - }; +/***/ 45730: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const extglobOpen = (type, value) => { - const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; +"use strict"; - token.prev = prev; - token.parens = state.parens; - token.output = state.output; - const output = (opts.capture ? '(' : '') + token.open; +const path = __nccwpck_require__(85622); +const findUp = __nccwpck_require__(2885); +const readPkg = __nccwpck_require__(19003); - increment('parens'); - push({ type, value, output: state.output ? '' : ONE_CHAR }); - push({ type: 'paren', extglob: true, value: advance(), output }); - extglobs.push(token); - }; +module.exports = async options => { + const filePath = await findUp('package.json', options); - const extglobClose = token => { - let output = token.close + (opts.capture ? ')' : ''); + if (!filePath) { + return; + } - if (token.type === 'negate') { - let extglobStar = star; + return { + packageJson: await readPkg({...options, cwd: path.dirname(filePath)}), + path: filePath + }; +}; - if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { - extglobStar = globstar(opts); - } +module.exports.sync = options => { + const filePath = findUp.sync('package.json', options); - if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { - output = token.close = `)$))${extglobStar}`; - } + if (!filePath) { + return; + } - if (token.prev.type === 'bos' && eos()) { - state.negatedExtglob = true; - } - } + return { + packageJson: readPkg.sync({...options, cwd: path.dirname(filePath)}), + path: filePath + }; +}; - push({ type: 'paren', extglob: true, value, output }); - decrement('parens'); - }; - /** - * Fast paths - */ +/***/ }), - if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { - let backslashes = false; +/***/ 19003: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { - if (first === '\\') { - backslashes = true; - return m; - } +"use strict"; - if (first === '?') { - if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ''); - } - if (index === 0) { - return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); - } - return QMARK.repeat(chars.length); - } +const {promisify} = __nccwpck_require__(31669); +const fs = __nccwpck_require__(35747); +const path = __nccwpck_require__(85622); +const parseJson = __nccwpck_require__(52518); - if (first === '.') { - return DOT_LITERAL.repeat(chars.length); - } +const readFileAsync = promisify(fs.readFile); - if (first === '*') { - if (esc) { - return esc + first + (rest ? star : ''); - } - return star; - } - return esc ? m : `\\${m}`; - }); +module.exports = async options => { + options = { + cwd: process.cwd(), + normalize: true, + ...options + }; - if (backslashes === true) { - if (opts.unescape === true) { - output = output.replace(/\\/g, ''); - } else { - output = output.replace(/\\+/g, m => { - return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); - }); - } - } + const filePath = path.resolve(options.cwd, 'package.json'); + const json = parseJson(await readFileAsync(filePath, 'utf8')); - if (output === input && opts.contains === true) { - state.output = input; - return state; - } + if (options.normalize) { + __nccwpck_require__(44586)(json); + } - state.output = utils.wrapOutput(output, state, options); - return state; - } + return json; +}; - /** - * Tokenize input until we reach end-of-string - */ +module.exports.sync = options => { + options = { + cwd: process.cwd(), + normalize: true, + ...options + }; - while (!eos()) { - value = advance(); + const filePath = path.resolve(options.cwd, 'package.json'); + const json = parseJson(fs.readFileSync(filePath, 'utf8')); - if (value === '\u0000') { - continue; - } + if (options.normalize) { + __nccwpck_require__(44586)(json); + } - /** - * Escaped characters - */ + return json; +}; - if (value === '\\') { - const next = peek(); - if (next === '/' && opts.bash !== true) { - continue; - } +/***/ }), - if (next === '.' || next === ';') { - continue; - } +/***/ 92036: +/***/ ((module) => { - if (!next) { - value += '\\'; - push({ type: 'text', value }); - continue; - } +"use strict"; - // collapse slashes to reduce potential for exploits - const match = /^\\+/.exec(remaining()); - let slashes = 0; - if (match && match[0].length > 2) { - slashes = match[0].length; - state.index += slashes; - if (slashes % 2 !== 0) { - value += '\\'; - } - } +const codes = {}; - if (opts.unescape === true) { - value = advance() || ''; - } else { - value += advance() || ''; - } +function createErrorType(code, message, Base) { + if (!Base) { + Base = Error + } - if (state.brackets === 0) { - push({ type: 'text', value }); - continue; - } + function getMessage (arg1, arg2, arg3) { + if (typeof message === 'string') { + return message + } else { + return message(arg1, arg2, arg3) } + } - /** - * If we're inside a regex character class, continue - * until we reach the closing bracket. - */ - - if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { - if (opts.posix !== false && value === ':') { - const inner = prev.value.slice(1); - if (inner.includes('[')) { - prev.posix = true; + class NodeError extends Base { + constructor (arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } - if (inner.includes(':')) { - const idx = prev.value.lastIndexOf('['); - const pre = prev.value.slice(0, idx); - const rest = prev.value.slice(idx + 2); - const posix = POSIX_REGEX_SOURCE[rest]; - if (posix) { - prev.value = pre + posix; - state.backtrack = true; - advance(); + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; - if (!bos.output && tokens.indexOf(prev) === 1) { - bos.output = ONE_CHAR; - } - continue; - } - } - } - } + codes[code] = NodeError; +} - if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { - value = `\\${value}`; - } +// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js +function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i) => String(i)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } +} - if (value === ']' && (prev.value === '[' || prev.value === '[^')) { - value = `\\${value}`; - } +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith +function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; +} - if (opts.posix === true && value === '!' && prev.value === '[') { - value = '^'; - } +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith +function endsWith(str, search, this_len) { + if (this_len === undefined || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; +} - prev.value += value; - append({ value }); - continue; - } +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes +function includes(str, search, start) { + if (typeof start !== 'number') { + start = 0; + } - /** - * If we're inside a quoted string, continue - * until we reach the closing double quote. - */ + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } +} - if (state.quotes === 1 && value !== '"') { - value = utils.escapeRegex(value); - prev.value += value; - append({ value }); - continue; - } +createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"' +}, TypeError); +createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { + // determiner: 'must be' or 'must not be' + let determiner; + if (typeof expected === 'string' && startsWith(expected, 'not ')) { + determiner = 'must not be'; + expected = expected.replace(/^not /, ''); + } else { + determiner = 'must be'; + } - /** - * Double quotes - */ + let msg; + if (endsWith(name, ' argument')) { + // For cases like 'first argument' + msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; + } else { + const type = includes(name, '.') ? 'property' : 'argument'; + msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; + } - if (value === '"') { - state.quotes = state.quotes === 1 ? 0 : 1; - if (opts.keepQuotes === true) { - push({ type: 'text', value }); - } - continue; - } + msg += `. Received type ${typeof actual}`; + return msg; +}, TypeError); +createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); +createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { + return 'The ' + name + ' method is not implemented' +}); +createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); +createErrorType('ERR_STREAM_DESTROYED', function (name) { + return 'Cannot call ' + name + ' after a stream was destroyed'; +}); +createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); +createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); +createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); +createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); +createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { + return 'Unknown encoding: ' + arg +}, TypeError); +createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - /** - * Parentheses - */ +module.exports.q = codes; - if (value === '(') { - increment('parens'); - push({ type: 'paren', value }); - continue; - } - if (value === ')') { - if (state.parens === 0 && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '(')); - } +/***/ }), - const extglob = extglobs[extglobs.length - 1]; - if (extglob && state.parens === extglob.parens + 1) { - extglobClose(extglobs.pop()); - continue; - } +/***/ 42770: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); - decrement('parens'); - continue; - } +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. - /** - * Square brackets - */ +/**/ - if (value === '[') { - if (opts.nobracket === true || !remaining().includes(']')) { - if (opts.nobracket !== true && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('closing', ']')); - } +var objectKeys = Object.keys || function (obj) { + var keys = []; - value = `\\${value}`; - } else { - increment('brackets'); - } + for (var key in obj) { + keys.push(key); + } - push({ type: 'bracket', value }); - continue; - } + return keys; +}; +/**/ - if (value === ']') { - if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { - push({ type: 'text', value, output: `\\${value}` }); - continue; - } - if (state.brackets === 0) { - if (opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '[')); - } +module.exports = Duplex; - push({ type: 'text', value, output: `\\${value}` }); - continue; - } +var Readable = __nccwpck_require__(79341); - decrement('brackets'); +var Writable = __nccwpck_require__(78063); - const prevValue = prev.value.slice(1); - if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { - value = `/${value}`; - } +__nccwpck_require__(2989)(Duplex, Readable); - prev.value += value; - append({ value }); +{ + // Allow the keys array to be GC'ed. + var keys = objectKeys(Writable.prototype); - // when literal brackets are explicitly disabled - // assume we should match with a regex character class - if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { - continue; - } + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} - const escaped = utils.escapeRegex(prev.value); - state.output = state.output.slice(0, -prev.value.length); +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; - // when literal brackets are explicitly enabled - // assume we should escape the brackets to match literal characters - if (opts.literalBrackets === true) { - state.output += escaped; - prev.value = escaped; - continue; - } + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; - // when the user specifies nothing, try to match both - prev.value = `(${capture}${escaped}|${prev.value})`; - state.output += prev.value; - continue; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once('end', onend); } + } +} - /** - * Braces - */ +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); +Object.defineProperty(Duplex.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); +Object.defineProperty(Duplex.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } +}); // the no-half-open enforcer - if (value === '{' && opts.nobrace !== true) { - increment('braces'); +function onend() { + // If the writable side ended, then we're ok. + if (this._writableState.ended) return; // no more data can be written. + // But allow more writes to happen in this tick. - const open = { - type: 'brace', - value, - output: '(', - outputIndex: state.output.length, - tokensIndex: state.tokens.length - }; + process.nextTick(onEndNT, this); +} - braces.push(open); - push(open); - continue; - } +function onEndNT(self) { + self.end(); +} - if (value === '}') { - const brace = braces[braces.length - 1]; +Object.defineProperty(Duplex.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } - if (opts.nobrace === true || !brace) { - push({ type: 'text', value, output: value }); - continue; - } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed - let output = ')'; - if (brace.dots === true) { - const arr = tokens.slice(); - const range = []; + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); - for (let i = arr.length - 1; i >= 0; i--) { - tokens.pop(); - if (arr[i].type === 'brace') { - break; - } - if (arr[i].type !== 'dots') { - range.unshift(arr[i].value); - } - } +/***/ }), - output = expandRange(range, opts); - state.backtrack = true; - } +/***/ 60143: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (brace.comma !== true && brace.dots !== true) { - const out = state.output.slice(0, brace.outputIndex); - const toks = state.tokens.slice(brace.tokensIndex); - brace.value = brace.output = '\\{'; - value = output = '\\}'; - state.output = out; - for (const t of toks) { - state.output += (t.output || t.value); - } - } +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. - push({ type: 'brace', value, output }); - decrement('braces'); - braces.pop(); - continue; - } - /** - * Pipes - */ +module.exports = PassThrough; - if (value === '|') { - if (extglobs.length > 0) { - extglobs[extglobs.length - 1].conditions++; - } - push({ type: 'text', value }); - continue; - } +var Transform = __nccwpck_require__(62826); - /** - * Commas - */ +__nccwpck_require__(2989)(PassThrough, Transform); - if (value === ',') { - let output = value; +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); +} - const brace = braces[braces.length - 1]; - if (brace && stack[stack.length - 1] === 'braces') { - brace.comma = true; - output = '|'; - } +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; - push({ type: 'comma', value, output }); - continue; - } +/***/ }), - /** - * Slashes - */ +/***/ 79341: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (value === '/') { - // if the beginning of the glob is "./", advance the start - // to the current index, and don't add the "./" characters - // to the state. This greatly simplifies lookbehinds when - // checking for BOS characters like "!" and "." (not "./") - if (prev.type === 'dot' && state.index === state.start + 1) { - state.start = state.index + 1; - state.consumed = ''; - state.output = ''; - tokens.pop(); - prev = bos; // reset "prev" to the first token - continue; - } +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - push({ type: 'slash', value, output: SLASH_LITERAL }); - continue; - } - /** - * Dots - */ +module.exports = Readable; +/**/ - if (value === '.') { - if (state.braces > 0 && prev.type === 'dot') { - if (prev.value === '.') prev.output = DOT_LITERAL; - const brace = braces[braces.length - 1]; - prev.type = 'dots'; - prev.output += value; - prev.value += value; - brace.dots = true; - continue; - } +var Duplex; +/**/ - if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { - push({ type: 'text', value, output: DOT_LITERAL }); - continue; - } +Readable.ReadableState = ReadableState; +/**/ - push({ type: 'dot', value, output: DOT_LITERAL }); - continue; - } +var EE = __nccwpck_require__(28614).EventEmitter; - /** - * Question marks - */ +var EElistenerCount = function EElistenerCount(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ - if (value === '?') { - const isGroup = prev && prev.value === '('; - if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('qmark', value); - continue; - } +/**/ - if (prev && prev.type === 'paren') { - const next = peek(); - let output = value; - if (next === '<' && !utils.supportsLookbehinds()) { - throw new Error('Node.js v10 or higher is required for regex lookbehinds'); - } +var Stream = __nccwpck_require__(1065); +/**/ - if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { - output = `\\${value}`; - } - push({ type: 'text', value, output }); - continue; - } +var Buffer = __nccwpck_require__(64293).Buffer; - if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { - push({ type: 'qmark', value, output: QMARK_NO_DOT }); - continue; - } +var OurUint8Array = global.Uint8Array || function () {}; - push({ type: 'qmark', value, output: QMARK }); - continue; - } +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} - /** - * Exclamation - */ +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} +/**/ - if (value === '!') { - if (opts.noextglob !== true && peek() === '(') { - if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { - extglobOpen('negate', value); - continue; - } - } - if (opts.nonegate !== true && state.index === 0) { - negate(); - continue; - } - } +var debugUtil = __nccwpck_require__(31669); - /** - * Plus - */ +var debug; - if (value === '+') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('plus', value); - continue; - } +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function debug() {}; +} +/**/ - if ((prev && prev.value === '(') || opts.regex === false) { - push({ type: 'plus', value, output: PLUS_LITERAL }); - continue; - } - if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { - push({ type: 'plus', value }); - continue; - } +var BufferList = __nccwpck_require__(29464); - push({ type: 'plus', value: PLUS_LITERAL }); - continue; - } +var destroyImpl = __nccwpck_require__(87915); - /** - * Plain text - */ +var _require = __nccwpck_require__(13400), + getHighWaterMark = _require.getHighWaterMark; - if (value === '@') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - push({ type: 'at', extglob: true, value, output: '' }); - continue; - } +var _require$codes = __nccwpck_require__(92036)/* .codes */ .q, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - push({ type: 'text', value }); - continue; - } - /** - * Plain text - */ +var StringDecoder; +var createReadableStreamAsyncIterator; +var from; - if (value !== '*') { - if (value === '$' || value === '^') { - value = `\\${value}`; - } +__nccwpck_require__(2989)(Readable, Stream); - const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); - if (match) { - value += match[0]; - state.index += match[0].length; - } +var errorOrDestroy = destroyImpl.errorOrDestroy; +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - push({ type: 'text', value }); - continue; - } +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. - /** - * Stars - */ + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} - if (prev && (prev.type === 'globstar' || prev.star === true)) { - prev.type = 'star'; - prev.star = true; - prev.value += value; - prev.output = star; - state.backtrack = true; - state.globstar = true; - consume(value); - continue; - } +function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || __nccwpck_require__(42770); + options = options || {}; // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. - let rest = remaining(); - if (opts.noextglob !== true && /^\([^?]/.test(rest)) { - extglobOpen('star', value); - continue; - } + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away - if (prev.type === 'star') { - if (opts.noglobstar === true) { - consume(value); - continue; - } + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" - const prior = prev.prev; - const before = prior.prev; - const isStart = prior.type === 'slash' || prior.type === 'bos'; - const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() - if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { - push({ type: 'star', value, output: '' }); - continue; - } + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. - const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); - const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); - if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { - push({ type: 'star', value, output: '' }); - continue; - } + this.sync = true; // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. - // strip consecutive `/**/` - while (rest.slice(0, 3) === '/**') { - const after = input[state.index + 4]; - if (after && after !== '/') { - break; - } - rest = rest.slice(3); - consume('/**', 3); - } + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; // Should close be emitted on destroy. Defaults to true. - if (prior.type === 'bos' && eos()) { - prev.type = 'globstar'; - prev.value += value; - prev.output = globstar(opts); - state.output = prev.output; - state.globstar = true; - consume(value); - continue; - } + this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') - if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; + this.autoDestroy = !!options.autoDestroy; // has it been destroyed - prev.type = 'globstar'; - prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); - prev.value += value; - state.globstar = true; - state.output += prior.output + prev.output; - consume(value); - continue; - } + this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. - if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { - const end = rest[1] !== void 0 ? '|$' : ''; + this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; + this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled - prev.type = 'globstar'; - prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; - prev.value += value; + this.readingMore = false; + this.decoder = null; + this.encoding = null; - state.output += prior.output + prev.output; - state.globstar = true; + if (options.encoding) { + if (!StringDecoder) StringDecoder = __nccwpck_require__(90937)/* .StringDecoder */ .s; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} - consume(value + advance()); +function Readable(options) { + Duplex = Duplex || __nccwpck_require__(42770); + if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside + // the ReadableState constructor, at least with V8 6.5 - push({ type: 'slash', value: '/', output: '' }); - continue; - } + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); // legacy - if (prior.type === 'bos' && rest[0] === '/') { - prev.type = 'globstar'; - prev.value += value; - prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; - state.output = prev.output; - state.globstar = true; - consume(value + advance()); - push({ type: 'slash', value: '/', output: '' }); - continue; - } + this.readable = true; - // remove single star from output - state.output = state.output.slice(0, -prev.output.length); + if (options) { + if (typeof options.read === 'function') this._read = options.read; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } - // reset previous token to globstar - prev.type = 'globstar'; - prev.output = globstar(opts); - prev.value += value; + Stream.call(this); +} - // reset output with globstar - state.output += prev.output; - state.globstar = true; - consume(value); - continue; +Object.defineProperty(Readable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === undefined) { + return false; } - const token = { type: 'star', value, output: star }; + return this._readableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed - if (opts.bash === true) { - token.output = '.*?'; - if (prev.type === 'bos' || prev.type === 'slash') { - token.output = nodot + token.output; + + this._readableState.destroyed = value; + } +}); +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; + +Readable.prototype._destroy = function (err, cb) { + cb(err); +}; // Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. + + +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; } - push(token); - continue; - } - if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { - token.output = value; - push(token); - continue; + skipChunkCheck = true; } + } else { + skipChunkCheck = true; + } - if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { - if (prev.type === 'dot') { - state.output += NO_DOT_SLASH; - prev.output += NO_DOT_SLASH; + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; // Unshift should *always* be something directly out of read() - } else if (opts.dot === true) { - state.output += NO_DOTS_SLASH; - prev.output += NO_DOTS_SLASH; - } else { - state.output += nodot; - prev.output += nodot; - } +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; - if (peek() !== '*') { - state.output += ONE_CHAR; - prev.output += ONE_CHAR; +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + debug('readableAddChunk', chunk); + var state = stream._readableState; + + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + + if (er) { + errorOrDestroy(stream, er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); } - } - push(token); - } + if (addToFront) { + if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); + } else if (state.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; - while (state.brackets > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); - state.output = utils.escapeLast(state.output, '['); - decrement('brackets'); - } + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream, state); + } + } // We can push more data if we are below the highWaterMark. + // Also, if we have no data yet, we can stand some more bytes. + // This is to work around cases where hwm=0, such as the repl. - while (state.parens > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); - state.output = utils.escapeLast(state.output, '('); - decrement('parens'); - } - while (state.braces > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); - state.output = utils.escapeLast(state.output, '{'); - decrement('braces'); - } + return !state.ended && (state.length < state.highWaterMark || state.length === 0); +} - if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { - push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream.emit('data', chunk); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream); } - // rebuild the output if we had to backtrack at any point - if (state.backtrack === true) { - state.output = ''; + maybeReadMore(stream, state); +} - for (const token of state.tokens) { - state.output += token.output != null ? token.output : token.value; +function chunkInvalid(state, chunk) { + var er; - if (token.suffix) { - state.output += token.suffix; - } - } + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); } - return state; -}; + return er; +} -/** - * Fast paths for creating regular expressions for common glob patterns. - * This can significantly speed up processing and has very little downside - * impact when none of the fast paths match. - */ +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; // backwards compatibility. -parse.fastpaths = (input, options) => { - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - const len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } - input = REPLACEMENTS[input] || input; - const win32 = utils.isWindows(options); +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = __nccwpck_require__(90937)/* .StringDecoder */ .s; + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 - // create constants based on platform, for windows or posix - const { - DOT_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOTS_SLASH, - STAR, - START_ANCHOR - } = constants.globChars(win32); + this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: - const nodot = opts.dot ? NO_DOTS : NO_DOT; - const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; - const capture = opts.capture ? '' : '?:'; - const state = { negated: false, prefix: '' }; - let star = opts.bash === true ? '.*?' : STAR; + var p = this._readableState.buffer.head; + var content = ''; - if (opts.capture) { - star = `(${star})`; + while (p !== null) { + content += decoder.write(p.data); + p = p.next; } - const globstar = (opts) => { - if (opts.noglobstar === true) return star; - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; + this._readableState.buffer.clear(); - const create = str => { - switch (str) { - case '*': - return `${nodot}${ONE_CHAR}${star}`; + if (content !== '') this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; +}; // Don't raise the hwm > 1GB - case '.*': - return `${DOT_LITERAL}${ONE_CHAR}${star}`; - case '*.*': - return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; +var MAX_HWM = 0x40000000; - case '*/*': - return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } - case '**': - return nodot + globstar(opts); + return n; +} // This function is designed to be inlinable, so please take care when making +// changes to the function body. - case '**/*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; - case '**/*.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; - case '**/.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } // If we're asking for more than the current hwm, then raise the hwm. - default: { - const match = /^(.*?)\.(\w+)$/.exec(str); - if (!match) return; - const source = create(match[1]); - if (!source) return; + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; // Don't have enough - return source + DOT_LITERAL + match[2]; - } - } - }; + if (!state.ended) { + state.needReadable = true; + return 0; + } - const output = utils.removePrefix(input, state); - let source = create(output); + return state.length; +} // you can override either this method, or the async _read(n) below. - if (source && opts.strictSlashes !== true) { - source += `${SLASH_LITERAL}?`; + +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + + if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; } - return source; -}; + n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. -module.exports = parse; + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + // if we need a readable event, then we need to do some reading. -/***/ }), + var doRead = state.needReadable; + debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some -/***/ 47188: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. -"use strict"; + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; // if the length is currently zero, then we *need* a readable event. -const path = __webpack_require__(85622); -const scan = __webpack_require__(15715); -const parse = __webpack_require__(3155); -const utils = __webpack_require__(86444); -const constants = __webpack_require__(1259); -const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + if (state.length === 0) state.needReadable = true; // call internal read method -/** - * Creates a matcher function from one or more glob patterns. The - * returned function takes a string to match as its first argument, - * and returns true if the string is a match. The returned matcher - * function also takes a boolean as the second argument that, when true, - * returns an object with additional information. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch(glob[, options]); - * - * const isMatch = picomatch('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @name picomatch - * @param {String|Array} `globs` One or more glob patterns. - * @param {Object=} `options` - * @return {Function=} Returns a matcher function. - * @api public - */ + this._read(state.highWaterMark); -const picomatch = (glob, options, returnState = false) => { - if (Array.isArray(glob)) { - const fns = glob.map(input => picomatch(input, options, returnState)); - const arrayMatcher = str => { - for (const isMatch of fns) { - const state = isMatch(str); - if (state) return state; - } - return false; - }; - return arrayMatcher; + state.sync = false; // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + + if (!state.reading) n = howMuchToRead(nOrig, state); } - const isState = isObject(glob) && glob.tokens && glob.input; + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; - if (glob === '' || (typeof glob !== 'string' && !isState)) { - throw new TypeError('Expected pattern to be a non-empty string'); + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n = 0; + } else { + state.length -= n; + state.awaitDrain = 0; } - const opts = options || {}; - const posix = utils.isWindows(options); - const regex = isState - ? picomatch.compileRe(glob, options) - : picomatch.makeRe(glob, options, false, true); - - const state = regex.state; - delete regex.state; + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. - let isIgnored = () => false; - if (opts.ignore) { - const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; - isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + if (nOrig !== n && state.ended) endReadable(this); } - const matcher = (input, returnObject = false) => { - const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); - const result = { glob, state, regex, posix, input, output, match, isMatch }; + if (ret !== null) this.emit('data', ret); + return ret; +}; - if (typeof opts.onResult === 'function') { - opts.onResult(result); - } +function onEofChunk(stream, state) { + debug('onEofChunk'); + if (state.ended) return; - if (isMatch === false) { - result.isMatch = false; - return returnObject ? result : false; - } + if (state.decoder) { + var chunk = state.decoder.end(); - if (isIgnored(input)) { - if (typeof opts.onIgnore === 'function') { - opts.onIgnore(result); - } - result.isMatch = false; - return returnObject ? result : false; + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; } + } - if (typeof opts.onMatch === 'function') { - opts.onMatch(result); - } - return returnObject ? result : true; - }; + state.ended = true; - if (returnState) { - matcher.state = state; + if (state.sync) { + // if we are sync, wait until next tick to emit the data. + // Otherwise we risk emitting data in the flow() + // the readable code triggers during a read() call + emitReadable(stream); + } else { + // emit 'readable' now to make sure it gets picked up. + state.needReadable = false; + + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream); + } } +} // Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. - return matcher; -}; -/** - * Test `input` with the given `regex`. This is used by the main - * `picomatch()` function to test the input string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.test(input, regex[, options]); - * - * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); - * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } - * ``` - * @param {String} `input` String to test. - * @param {RegExp} `regex` - * @return {Object} Returns an object with matching info. - * @api public - */ +function emitReadable(stream) { + var state = stream._readableState; + debug('emitReadable', state.needReadable, state.emittedReadable); + state.needReadable = false; -picomatch.test = (input, regex, options, { glob, posix } = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected input to be a string'); + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + process.nextTick(emitReadable_, stream); } +} - if (input === '') { - return { isMatch: false, output: '' }; - } +function emitReadable_(stream) { + var state = stream._readableState; + debug('emitReadable_', state.destroyed, state.length, state.ended); - const opts = options || {}; - const format = opts.format || (posix ? utils.toPosixSlashes : null); - let match = input === glob; - let output = (match && format) ? format(input) : input; + if (!state.destroyed && (state.length || state.ended)) { + stream.emit('readable'); + state.emittedReadable = false; + } // The stream needs another readable event if + // 1. It is not flowing, as the flow mechanism will take + // care of it. + // 2. It is not ended. + // 3. It is below the highWaterMark, so we can schedule + // another readable later. - if (match === false) { - output = format ? format(input) : input; - match = output === glob; + + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow(stream); +} // at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. + + +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(maybeReadMore_, stream, state); } +} - if (match === false || opts.capture === true) { - if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input, regex, options, posix); - } else { - match = regex.exec(output); - } +function maybeReadMore_(stream, state) { + // Attempt to read more data if we should. + // + // The conditions for reading more data are (one of): + // - Not enough data buffered (state.length < state.highWaterMark). The loop + // is responsible for filling the buffer with enough data if such data + // is available. If highWaterMark is 0 and we are not in the flowing mode + // we should _not_ attempt to buffer any extra data. We'll get more data + // when the stream consumer calls read() instead. + // - No data in the buffer, and the stream is in flowing mode. In this mode + // the loop below is responsible for ensuring read() is called. Failing to + // call read here would abort the flow and there's no other mechanism for + // continuing the flow if the stream consumer has just subscribed to the + // 'data' event. + // + // In addition to the above conditions to keep reading data, the following + // conditions prevent the data from being read: + // - The stream has ended (state.ended). + // - There is already a pending 'read' operation (state.reading). This is a + // case where the the stream has called the implementation defined _read() + // method, but they are processing the call asynchronously and have _not_ + // called push() with new data. In this case we skip performing more + // read()s. The execution ends in this method again after the _read() ends + // up calling push() with more data. + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) // didn't get any data, stop spinning. + break; } - return { isMatch: Boolean(match), match, output }; -}; + state.readingMore = false; +} // abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. -/** - * Match the basename of a filepath. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.matchBase(input, glob[, options]); - * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true - * ``` - * @param {String} `input` String to test. - * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). - * @return {Boolean} - * @api public - */ -picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { - const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); - return regex.test(path.basename(input)); +Readable.prototype._read = function (n) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); }; -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.isMatch(string, patterns[, options]); - * - * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String|Array} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const picomatch = require('picomatch'); - * const result = picomatch.parse(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as a regex source string. - * @api public - */ + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; -picomatch.parse = (pattern, options) => { - if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); - return parse(pattern, { ...options, fastpaths: false }); -}; + case 1: + state.pipes = [state.pipes, dest]; + break; -/** - * Scan a glob pattern to separate the pattern into segments. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.scan(input[, options]); - * - * const result = picomatch.scan('!./foo/*.js'); - * console.log(result); - * { prefix: '!./', - * input: '!./foo/*.js', - * start: 3, - * base: 'foo', - * glob: '*.js', - * isBrace: false, - * isBracket: false, - * isGlob: true, - * isExtglob: false, - * isGlobstar: false, - * negated: true } - * ``` - * @param {String} `input` Glob pattern to scan. - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ + default: + state.pipes.push(dest); + break; + } -picomatch.scan = (input, options) => scan(input, options); + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); + dest.on('unpipe', onunpipe); -/** - * Create a regular expression from a parsed glob pattern. - * - * ```js - * const picomatch = require('picomatch'); - * const state = picomatch.parse('*.js'); - * // picomatch.compileRe(state[, options]); - * - * console.log(picomatch.compileRe(state)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `state` The object returned from the `.parse` method. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); -picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => { - if (returnOutput === true) { - return parsed.output; + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } } - const opts = options || {}; - const prepend = opts.contains ? '' : '^'; - const append = opts.contains ? '' : '$'; + function onend() { + debug('onend'); + dest.end(); + } // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. - let source = `${prepend}(?:${parsed.output})${append}`; - if (parsed && parsed.negated === true) { - source = `^(?!${source}).*$`; - } - const regex = picomatch.toRegex(source, options); - if (returnState === true) { - regex.state = parsed; - } + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + var cleanedUp = false; - return regex; -}; + function cleanup() { + debug('cleanup'); // cleanup event handlers once the pipe is broken -picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => { - if (!input || typeof input !== 'string') { - throw new TypeError('Expected a non-empty string'); + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + cleanedUp = true; // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } - const opts = options || {}; - let parsed = { negated: false, fastpaths: true }; - let prefix = ''; - let output; + src.on('data', ondata); - if (input.startsWith('./')) { - input = input.slice(2); - prefix = parsed.prefix = './'; - } + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + debug('dest.write', ret); - if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { - output = parse.fastpaths(input, options); + if (ret === false) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', state.awaitDrain); + state.awaitDrain++; + } + + src.pause(); + } + } // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + + + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); + } // Make sure our error handler is attached before userland ones. + + + prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. + + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); } - if (output === undefined) { - parsed = parse(input, options); - parsed.prefix = prefix + (parsed.prefix || ''); - } else { - parsed.output = output; + dest.once('close', onclose); + + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); } - return picomatch.compileRe(parsed, options, returnOutput, returnState); -}; + dest.once('finish', onfinish); -/** - * Create a regular expression from the given regex source string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.toRegex(source[, options]); - * - * const { output } = picomatch.parse('*.js'); - * console.log(picomatch.toRegex(output)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `source` Regular expression source string. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } // tell the dest that it's being piped to -picomatch.toRegex = (source, options) => { - try { - const opts = options || {}; - return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); - } catch (err) { - if (options && options.debug === true) throw err; - return /$^/; - } -}; -/** - * Picomatch constants. - * @return {Object} - */ + dest.emit('pipe', src); // start the flow if it hasn't been started already. -picomatch.constants = constants; + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } -/** - * Expose "picomatch" - */ + return dest; +}; -module.exports = picomatch; +function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} -/***/ }), +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; // if we're not piping anywhere, then do nothing. -/***/ 15715: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + if (state.pipesCount === 0) return this; // just one destination. most common case. -"use strict"; + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + if (!dest) dest = state.pipes; // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } // slow case. multiple pipe destinations. -const utils = __webpack_require__(86444); -const { - CHAR_ASTERISK, /* * */ - CHAR_AT, /* @ */ - CHAR_BACKWARD_SLASH, /* \ */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_EXCLAMATION_MARK, /* ! */ - CHAR_FORWARD_SLASH, /* / */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_PLUS, /* + */ - CHAR_QUESTION_MARK, /* ? */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_RIGHT_SQUARE_BRACKET /* ] */ -} = __webpack_require__(1259); -const isPathSeparator = code => { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -}; + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; -const depth = token => { - if (token.isPrefix !== true) { - token.depth = token.isGlobstar ? Infinity : 1; - } -}; + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, { + hasUnpiped: false + }); + } -/** - * Quickly scans a glob pattern and returns an object with a handful of - * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), - * `glob` (the actual pattern), and `negated` (true if the path starts with `!`). - * - * ```js - * const pm = require('picomatch'); - * console.log(pm.scan('foo/bar/*.js')); - * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an object with tokens and regex source string. - * @api public - */ + return this; + } // try to find the right one. -const scan = (input, options) => { - const opts = options || {}; - const length = input.length - 1; - const scanToEnd = opts.parts === true || opts.scanToEnd === true; - const slashes = []; - const tokens = []; - const parts = []; + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit('unpipe', this, unpipeInfo); + return this; +}; // set up data events if they are asked for +// Ensure readable listeners eventually get something - let str = input; - let index = -1; - let start = 0; - let lastIndex = 0; - let isBrace = false; - let isBracket = false; - let isGlob = false; - let isExtglob = false; - let isGlobstar = false; - let braceEscaped = false; - let backslashes = false; - let negated = false; - let finished = false; - let braces = 0; - let prev; - let code; - let token = { value: '', depth: 0, isGlob: false }; - const eos = () => index >= length; - const peek = () => str.charCodeAt(index + 1); - const advance = () => { - prev = code; - return str.charCodeAt(++index); - }; +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + var state = this._readableState; - while (index < length) { - code = advance(); - let next; + if (ev === 'data') { + // update readableListening so that resume() may be a no-op + // a few lines down. This is needed to support once('readable'). + state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); + if (state.flowing !== false) this.resume(); + } else if (ev === 'readable') { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug('on readable', state.length, state.reading); - if (code === CHAR_LEFT_CURLY_BRACE) { - braceEscaped = true; + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process.nextTick(nReadingNextTick, this); } - continue; } + } - if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { - braces++; + return res; +}; - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } +Readable.prototype.addListener = Readable.prototype.on; + +Readable.prototype.removeListener = function (ev, fn) { + var res = Stream.prototype.removeListener.call(this, ev, fn); + + if (ev === 'readable') { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } + + return res; +}; - if (code === CHAR_LEFT_CURLY_BRACE) { - braces++; - continue; - } +Readable.prototype.removeAllListeners = function (ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); - if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; + if (ev === 'readable' || ev === undefined) { + // We need to check if there is someone still listening to + // readable and reset the state. However this needs to happen + // after readable has been emitted but before I/O (nextTick) to + // support once('readable', fn) cycles. This means that calling + // resume within the same tick will have no + // effect. + process.nextTick(updateReadableListening, this); + } - if (scanToEnd === true) { - continue; - } + return res; +}; - break; - } +function updateReadableListening(self) { + var state = self._readableState; + state.readableListening = self.listenerCount('readable') > 0; - if (braceEscaped !== true && code === CHAR_COMMA) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; + if (state.resumeScheduled && !state.paused) { + // flowing needs to be set to true now, otherwise + // the upcoming resume will not flow. + state.flowing = true; // crude way to check if we should resume + } else if (self.listenerCount('data') > 0) { + self.resume(); + } +} - if (scanToEnd === true) { - continue; - } +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} // pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. - break; - } - if (code === CHAR_RIGHT_CURLY_BRACE) { - braces--; +Readable.prototype.resume = function () { + var state = this._readableState; - if (braces === 0) { - braceEscaped = false; - isBrace = token.isBrace = true; - finished = true; - break; - } - } - } + if (!state.flowing) { + debug('resume'); // we flow only if there is no one listening + // for readable, but we still have to call + // resume() - if (scanToEnd === true) { - continue; - } + state.flowing = !state.readableListening; + resume(this, state); + } - break; - } + state.paused = false; + return this; +}; - if (code === CHAR_FORWARD_SLASH) { - slashes.push(index); - tokens.push(token); - token = { value: '', depth: 0, isGlob: false }; +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(resume_, stream, state); + } +} - if (finished === true) continue; - if (prev === CHAR_DOT && index === (start + 1)) { - start += 2; - continue; - } +function resume_(stream, state) { + debug('resume', state.reading); - lastIndex = index + 1; - continue; - } + if (!state.reading) { + stream.read(0); + } - if (opts.noext !== true) { - const isExtglobChar = code === CHAR_PLUS - || code === CHAR_AT - || code === CHAR_ASTERISK - || code === CHAR_QUESTION_MARK - || code === CHAR_EXCLAMATION_MARK; + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} - if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - isExtglob = token.isExtglob = true; - finished = true; +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + if (this._readableState.flowing !== false) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } - if (code === CHAR_RIGHT_PARENTHESES) { - isGlob = token.isGlob = true; - finished = true; - break; - } - } - continue; - } - break; - } - } + this._readableState.paused = true; + return this; +}; - if (code === CHAR_ASTERISK) { - if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; - isGlob = token.isGlob = true; - finished = true; +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); - if (scanToEnd === true) { - continue; - } - break; - } + while (state.flowing && stream.read() !== null) { + ; + } +} // wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. - if (code === CHAR_QUESTION_MARK) { - isGlob = token.isGlob = true; - finished = true; - if (scanToEnd === true) { - continue; - } - break; +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + stream.on('end', function () { + debug('wrapped end'); + + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); } - if (code === CHAR_LEFT_SQUARE_BRACKET) { - while (eos() !== true && (next = advance())) { - if (next === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } + _this.push(null); + }); + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - isBracket = token.isBracket = true; - isGlob = token.isGlob = true; - finished = true; + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - if (scanToEnd === true) { - continue; - } - break; - } - } + var ret = _this.push(chunk); + + if (!ret) { + paused = true; + stream.pause(); } + }); // proxy all the other methods. + // important when wrapping filters and duplexes. - if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { - negated = token.negated = true; - start++; - continue; + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + }(i); } + } // proxy certain important events. - if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_LEFT_PARENTHESES) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } // when we try to consume some more bytes, simply unpause the + // underlying stream. - if (code === CHAR_RIGHT_PARENTHESES) { - finished = true; - break; - } - } - continue; - } - break; + + this._read = function (n) { + debug('wrapped _read', n); + + if (paused) { + paused = false; + stream.resume(); } + }; - if (isGlob === true) { - finished = true; + return this; +}; - if (scanToEnd === true) { - continue; - } +if (typeof Symbol === 'function') { + Readable.prototype[Symbol.asyncIterator] = function () { + if (createReadableStreamAsyncIterator === undefined) { + createReadableStreamAsyncIterator = __nccwpck_require__(60863); + } - break; + return createReadableStreamAsyncIterator(this); + }; +} + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.highWaterMark; + } +}); +Object.defineProperty(Readable.prototype, 'readableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState && this._readableState.buffer; + } +}); +Object.defineProperty(Readable.prototype, 'readableFlowing', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.flowing; + }, + set: function set(state) { + if (this._readableState) { + this._readableState.flowing = state; } } +}); // exposed for testing purposes only. - if (opts.noext === true) { - isExtglob = false; - isGlob = false; +Readable._fromList = fromList; +Object.defineProperty(Readable.prototype, 'readableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.length; + } +}); // Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. + +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = state.buffer.consume(n, state.decoder); } + return ret; +} - let base = str; - let prefix = ''; - let glob = ''; +function endReadable(stream) { + var state = stream._readableState; + debug('endReadable', state.endEmitted); - if (start > 0) { - prefix = str.slice(0, start); - str = str.slice(start); - lastIndex -= start; + if (!state.endEmitted) { + state.ended = true; + process.nextTick(endReadableNT, state, stream); } +} - if (base && isGlob === true && lastIndex > 0) { - base = str.slice(0, lastIndex); - glob = str.slice(lastIndex); - } else if (isGlob === true) { - base = ''; - glob = str; - } else { - base = str; - } +function endReadableNT(state, stream) { + debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. - if (base && base !== '' && base !== '/' && base !== str) { - if (isPathSeparator(base.charCodeAt(base.length - 1))) { - base = base.slice(0, -1); - } - } + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); - if (opts.unescape === true) { - if (glob) glob = utils.removeBackslashes(glob); + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the writable side is ready for autoDestroy as well + var wState = stream._writableState; - if (base && backslashes === true) { - base = utils.removeBackslashes(base); + if (!wState || wState.autoDestroy && wState.finished) { + stream.destroy(); + } } } +} - const state = { - prefix, - input, - start, - base, - glob, - isBrace, - isBracket, - isGlob, - isExtglob, - isGlobstar, - negated +if (typeof Symbol === 'function') { + Readable.from = function (iterable, opts) { + if (from === undefined) { + from = __nccwpck_require__(32244); + } + + return from(Readable, iterable, opts); }; +} - if (opts.tokens === true) { - state.maxDepth = 0; - if (!isPathSeparator(code)) { - tokens.push(token); - } - state.tokens = tokens; +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; } - if (opts.parts === true || opts.tokens === true) { - let prevIndex; + return -1; +} - for (let idx = 0; idx < slashes.length; idx++) { - const n = prevIndex ? prevIndex + 1 : start; - const i = slashes[idx]; - const value = input.slice(n, i); - if (opts.tokens) { - if (idx === 0 && start !== 0) { - tokens[idx].isPrefix = true; - tokens[idx].value = prefix; - } else { - tokens[idx].value = value; - } - depth(tokens[idx]); - state.maxDepth += tokens[idx].depth; - } - if (idx !== 0 || value !== '') { - parts.push(value); - } - prevIndex = i; - } +/***/ }), - if (prevIndex && prevIndex + 1 < input.length) { - const value = input.slice(prevIndex + 1); - parts.push(value); +/***/ 62826: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (opts.tokens) { - tokens[tokens.length - 1].value = value; - depth(tokens[tokens.length - 1]); - state.maxDepth += tokens[tokens.length - 1].depth; - } - } +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. - state.slashes = slashes; - state.parts = parts; - } - return state; -}; +module.exports = Transform; -module.exports = scan; +var _require$codes = __nccwpck_require__(92036)/* .codes */ .q, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, + ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; +var Duplex = __nccwpck_require__(42770); -/***/ }), +__nccwpck_require__(2989)(Transform, Duplex); -/***/ 86444: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; -"use strict"; + if (cb === null) { + return this.emit('error', new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; -const path = __webpack_require__(85622); -const win32 = process.platform === 'win32'; -const { - REGEX_BACKSLASH, - REGEX_REMOVE_BACKSLASH, - REGEX_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_GLOBAL -} = __webpack_require__(1259); + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} -exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); -exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); -exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); -exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); -exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; // start out asking for a readable event once data is transformed. -exports.removeBackslashes = str => { - return str.replace(REGEX_REMOVE_BACKSLASH, match => { - return match === '\\' ? '' : match; - }); -}; + this._readableState.needReadable = true; // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. -exports.supportsLookbehinds = () => { - const segs = process.version.slice(1).split('.').map(Number); - if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { - return true; - } - return false; -}; + this._readableState.sync = false; -exports.isWindows = options => { - if (options && typeof options.windows === 'boolean') { - return options.windows; + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + if (typeof options.flush === 'function') this._flush = options.flush; + } // When the writable side finishes, then flush out anything remaining. + + + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function' && !this._readableState.destroyed) { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); } - return win32 === true || path.sep === '\\'; -}; +} -exports.escapeLast = (input, char, lastIdx) => { - const idx = input.lastIndexOf(char, lastIdx); - if (idx === -1) return input; - if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); - return `${input.slice(0, idx)}\\${input.slice(idx)}`; +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; // This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. + + +Transform.prototype._transform = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); }; -exports.removePrefix = (input, state = {}) => { - let output = input; - if (output.startsWith('./')) { - output = output.slice(2); - state.prefix = './'; +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } - return output; -}; +}; // Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. -exports.wrapOutput = (input, state = {}, options = {}) => { - const prepend = options.contains ? '' : '^'; - const append = options.contains ? '' : '$'; - let output = `${prepend}(?:${input})${append}`; - if (state.negated === true) { - output = `(?:^(?!${output}).*$)`; +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - return output; }; +Transform.prototype._destroy = function (err, cb) { + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); // TODO(BridgeAR): Write a test for these two error cases + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + + if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); +} /***/ }), -/***/ 4548: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 78063: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. -module.exports = typeof Promise === 'function' ? Promise : __webpack_require__(97609); +module.exports = Writable; +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} // It seems a linked list but it is not +// there will be only 2 of these for each stream -/***/ }), -/***/ 97609: -/***/ ((module) => { +function CorkedRequest(state) { + var _this = this; -"use strict"; + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ -var PENDING = 'pending'; -var SETTLED = 'settled'; -var FULFILLED = 'fulfilled'; -var REJECTED = 'rejected'; -var NOOP = function () {}; -var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; +/**/ -var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; -var asyncQueue = []; -var asyncTimer; -function asyncFlush() { - // run promise callbacks - for (var i = 0; i < asyncQueue.length; i++) { - asyncQueue[i][0](asyncQueue[i][1]); - } +var Duplex; +/**/ - // reset async asyncQueue - asyncQueue = []; - asyncTimer = false; -} +Writable.WritableState = WritableState; +/**/ -function asyncCall(callback, arg) { - asyncQueue.push([callback, arg]); +var internalUtil = { + deprecate: __nccwpck_require__(92262) +}; +/**/ - if (!asyncTimer) { - asyncTimer = true; - asyncSetTimer(asyncFlush, 0); - } -} +/**/ -function invokeResolver(resolver, promise) { - function resolvePromise(value) { - resolve(promise, value); - } +var Stream = __nccwpck_require__(1065); +/**/ - function rejectPromise(reason) { - reject(promise, reason); - } - try { - resolver(resolvePromise, rejectPromise); - } catch (e) { - rejectPromise(e); - } +var Buffer = __nccwpck_require__(64293).Buffer; + +var OurUint8Array = global.Uint8Array || function () {}; + +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); } -function invokeCallback(subscriber) { - var owner = subscriber.owner; - var settled = owner._state; - var value = owner._data; - var callback = subscriber[settled]; - var promise = subscriber.then; +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} - if (typeof callback === 'function') { - settled = FULFILLED; - try { - value = callback(value); - } catch (e) { - reject(promise, e); - } - } +var destroyImpl = __nccwpck_require__(87915); - if (!handleThenable(promise, value)) { - if (settled === FULFILLED) { - resolve(promise, value); - } +var _require = __nccwpck_require__(13400), + getHighWaterMark = _require.getHighWaterMark; - if (settled === REJECTED) { - reject(promise, value); - } - } -} +var _require$codes = __nccwpck_require__(92036)/* .codes */ .q, + ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, + ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, + ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, + ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, + ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, + ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; -function handleThenable(promise, value) { - var resolved; +var errorOrDestroy = destroyImpl.errorOrDestroy; - try { - if (promise === value) { - throw new TypeError('A promises callback cannot return that same promise.'); - } +__nccwpck_require__(2989)(Writable, Stream); - if (value && (typeof value === 'function' || typeof value === 'object')) { - // then should be retrieved only once - var then = value.then; +function nop() {} - if (typeof then === 'function') { - then.call(value, function (val) { - if (!resolved) { - resolved = true; +function WritableState(options, stream, isDuplex) { + Duplex = Duplex || __nccwpck_require__(42770); + options = options || {}; // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream, + // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - if (value === val) { - fulfill(promise, val); - } else { - resolve(promise, val); - } - } - }, function (reason) { - if (!resolved) { - resolved = true; + if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream + // contains buffers or objects. - reject(promise, reason); - } - }); + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() - return true; - } - } - } catch (e) { - if (!resolved) { - reject(promise, e); - } + this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called - return true; - } + this.finalCalled = false; // drain event flag. - return false; -} + this.needDrain = false; // at the start of calling end() -function resolve(promise, value) { - if (promise === value || !handleThenable(promise, value)) { - fulfill(promise, value); - } -} + this.ending = false; // when end() has been called, and returned -function fulfill(promise, value) { - if (promise._state === PENDING) { - promise._state = SETTLED; - promise._data = value; + this.ended = false; // when 'finish' is emitted - asyncCall(publishFulfillment, promise); - } -} + this.finished = false; // has it been destroyed -function reject(promise, reason) { - if (promise._state === PENDING) { - promise._state = SETTLED; - promise._data = reason; + this.destroyed = false; // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. - asyncCall(publishRejection, promise); - } -} + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. -function publish(promise) { - promise._then = promise._then.forEach(invokeCallback); -} + this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. -function publishFulfillment(promise) { - promise._state = FULFILLED; - publish(promise); -} + this.length = 0; // a flag to see when we're in the middle of a write. -function publishRejection(promise) { - promise._state = REJECTED; - publish(promise); - if (!promise._handled && isNode) { - global.process.emit('unhandledRejection', promise._data, promise); - } -} + this.writing = false; // when true all writes will be buffered until .uncork() call + + this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + + this.sync = true; // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + + this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) + + this.onwrite = function (er) { + onwrite(stream, er); + }; // the callback that the user supplies to write(chunk,encoding,cb) + + + this.writecb = null; // the amount that is being written when _write is called. + + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + + this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + + this.prefinished = false; // True if the error was already emitted and should not be thrown again -function notifyRejectionHandled(promise) { - global.process.emit('rejectionHandled', promise); + this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. + + this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') + + this.autoDestroy = !!options.autoDestroy; // count buffered requests + + this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + + this.corkedRequestsFree = new CorkedRequest(this); } -/** - * @class - */ -function Promise(resolver) { - if (typeof resolver !== 'function') { - throw new TypeError('Promise resolver ' + resolver + ' is not a function'); - } +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; - if (this instanceof Promise === false) { - throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); - } + while (current) { + out.push(current); + current = current.next; + } + + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); // Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. - this._then = []; - invokeResolver(resolver, this); +var realHasInstance; + +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function realHasInstance(object) { + return object instanceof this; + }; } -Promise.prototype = { - constructor: Promise, +function Writable(options) { + Duplex = Duplex || __nccwpck_require__(42770); // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + // Checking for a Stream.Duplex instance is faster here instead of inside + // the WritableState constructor, at least with V8 6.5 - _state: PENDING, - _then: null, - _data: undefined, - _handled: false, + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); // legacy. - then: function (onFulfillment, onRejection) { - var subscriber = { - owner: this, - then: new this.constructor(NOOP), - fulfilled: onFulfillment, - rejected: onRejection - }; + this.writable = true; - if ((onRejection || onFulfillment) && !this._handled) { - this._handled = true; - if (this._state === REJECTED && isNode) { - asyncCall(notifyRejectionHandled, this); - } - } + if (options) { + if (typeof options.write === 'function') this._write = options.write; + if (typeof options.writev === 'function') this._writev = options.writev; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (typeof options.final === 'function') this._final = options.final; + } - if (this._state === FULFILLED || this._state === REJECTED) { - // already resolved, call callback async - asyncCall(invokeCallback, subscriber); - } else { - // subscribe - this._then.push(subscriber); - } + Stream.call(this); +} // Otherwise people can pipe Writable streams, which is just wrong. - return subscriber.then; - }, - catch: function (onRejection) { - return this.then(null, onRejection); - } +Writable.prototype.pipe = function () { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; -Promise.all = function (promises) { - if (!Array.isArray(promises)) { - throw new TypeError('You must pass an array to Promise.all().'); - } +function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb - return new Promise(function (resolve, reject) { - var results = []; - var remaining = 0; + errorOrDestroy(stream, er); + process.nextTick(cb, er); +} // Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. - function resolver(index) { - remaining++; - return function (value) { - results[index] = value; - if (!--remaining) { - resolve(results); - } - }; - } - for (var i = 0, promise; i < promises.length; i++) { - promise = promises[i]; +function validChunk(stream, state, chunk, cb) { + var er; - if (promise && typeof promise.then === 'function') { - promise.then(resolver(i), reject); - } else { - results[i] = promise; - } - } + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== 'string' && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); + } - if (!remaining) { - resolve(results); - } - }); -}; + if (er) { + errorOrDestroy(stream, er); + process.nextTick(cb, er); + return false; + } -Promise.race = function (promises) { - if (!Array.isArray(promises)) { - throw new TypeError('You must pass an array to Promise.race().'); - } + return true; +} - return new Promise(function (resolve, reject) { - for (var i = 0, promise; i < promises.length; i++) { - promise = promises[i]; +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; - if (promise && typeof promise.then === 'function') { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - }); -}; + var isBuf = !state.objectMode && _isUint8Array(chunk); -Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } - return new Promise(function (resolve) { - resolve(value); - }); + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== 'function') cb = nop; + if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + return ret; }; -Promise.reject = function (reason) { - return new Promise(function (resolve, reject) { - reject(reason); - }); +Writable.prototype.cork = function () { + this._writableState.corked++; }; -module.exports = Promise; +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; +Object.defineProperty(Writable.prototype, 'writableBuffer', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } +}); -/***/ }), +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } -/***/ 32979: -/***/ ((module) => { + return chunk; +} -"use strict"; +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } +}); // if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. -module.exports = (url, opts) => { - if (typeof url !== 'string') { - throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``); - } +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); - url = url.trim(); - opts = Object.assign({https: false}, opts); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } - if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { - return url; - } + var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://'); -}; + if (!ret) state.needDrain = true; + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; -/***/ }), + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } -/***/ 9154: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } -module.exports = __webpack_require__(91341); + return ret; +} +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} -/***/ }), +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; -/***/ 91341: -/***/ ((module, exports) => { + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + process.nextTick(cb, er); // this can emit finish, and it will always happen + // after error -/*! - * node-progress - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ + process.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); // this can emit finish, but finish must + // always follow error -/** - * Expose `ProgressBar`. - */ + finishMaybe(stream, state); + } +} -exports = module.exports = ProgressBar; +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} -/** - * Initialize a `ProgressBar` with the given `fmt` string and `options` or - * `total`. - * - * Options: - * - * - `curr` current completed index - * - `total` total number of ticks to complete - * - `width` the displayed width of the progress bar defaulting to total - * - `stream` the output stream defaulting to stderr - * - `head` head character defaulting to complete character - * - `complete` completion character defaulting to "=" - * - `incomplete` incomplete character defaulting to "-" - * - `renderThrottle` minimum time between updates in milliseconds defaulting to 16 - * - `callback` optional function to call when the progress bar completes - * - `clear` will clear the progress bar upon termination - * - * Tokens: - * - * - `:bar` the progress bar itself - * - `:current` current tick number - * - `:total` total ticks - * - `:elapsed` time elapsed in seconds - * - `:percent` completion percentage - * - `:eta` eta in seconds - * - `:rate` rate of ticks per second - * - * @param {string} fmt - * @param {object|number} options or total - * @api public - */ +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state) || stream.destroyed; -function ProgressBar(fmt, options) { - this.stream = options.stream || process.stderr; + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - if (typeof(options) == 'number') { - var total = options; - options = {}; - options.total = total; - } else { - options = options || {}; - if ('string' != typeof fmt) throw new Error('format required'); - if ('number' != typeof options.total) throw new Error('total required'); + if (sync) { + process.nextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } } - - this.fmt = fmt; - this.curr = options.curr || 0; - this.total = options.total; - this.width = options.width || this.total; - this.clear = options.clear - this.chars = { - complete : options.complete || '=', - incomplete : options.incomplete || '-', - head : options.head || (options.complete || '=') - }; - this.renderThrottle = options.renderThrottle !== 0 ? (options.renderThrottle || 16) : 0; - this.lastRender = -Infinity; - this.callback = options.callback || function () {}; - this.tokens = {}; - this.lastDraw = ''; } -/** - * "tick" the progress bar with optional `len` and optional `tokens`. - * - * @param {number|object} len or tokens - * @param {object} tokens - * @api public - */ +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} // Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. -ProgressBar.prototype.tick = function(len, tokens){ - if (len !== 0) - len = len || 1; - // swap tokens - if ('object' == typeof len) tokens = len, len = 1; - if (tokens) this.tokens = tokens; +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} // if there's something in the buffer waiting, then process it - // start time for eta - if (0 == this.curr) this.start = new Date; - this.curr += len +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - // try to render - this.render(); + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; - // progress complete - if (this.curr >= this.total) { - this.render(undefined, true); - this.complete = true; - this.terminate(); - this.callback(this); - return; - } -}; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } -/** - * Method to render the progress bar with optional `tokens` to place in the - * progress bar's `fmt` field. - * - * @param {object} tokens - * @api public - */ + buffer.allBuffers = allBuffers; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite -ProgressBar.prototype.render = function (tokens, force) { - force = force !== undefined ? force : false; - if (tokens) this.tokens = tokens; + state.pendingcb++; + state.lastBufferedRequest = null; - if (!this.stream.isTTY) return; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } - var now = Date.now(); - var delta = now - this.lastRender; - if (!force && (delta < this.renderThrottle)) { - return; + state.bufferedRequestCount = 0; } else { - this.lastRender = now; + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; } - var ratio = this.curr / this.total; - ratio = Math.min(Math.max(ratio, 0), 1); + state.bufferedRequest = entry; + state.bufferProcessing = false; +} - var percent = Math.floor(ratio * 100); - var incomplete, complete, completeLength; - var elapsed = new Date - this.start; - var eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1); - var rate = this.curr / (elapsed / 1000); +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); +}; - /* populate the bar template with percentages and timestamps */ - var str = this.fmt - .replace(':current', this.curr) - .replace(':total', this.total) - .replace(':elapsed', isNaN(elapsed) ? '0.0' : (elapsed / 1000).toFixed(1)) - .replace(':eta', (isNaN(eta) || !isFinite(eta)) ? '0.0' : (eta / 1000) - .toFixed(1)) - .replace(':percent', percent.toFixed(0) + '%') - .replace(':rate', Math.round(rate)); +Writable.prototype._writev = null; - /* compute the available space (non-zero) for the bar */ - var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length); - if(availableSpace && process.platform === 'win32'){ - availableSpace = availableSpace - 1; - } +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - var width = Math.min(this.width, availableSpace); + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } - /* TODO: the following assumes the user has one ':bar' token */ - completeLength = Math.round(width * ratio); - complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete); - incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete); + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks - /* add head to the complete string */ - if(completeLength > 0) - complete = complete.slice(0, -1) + this.chars.head; + if (state.corked) { + state.corked = 1; + this.uncork(); + } // ignore unnecessary end() calls. - /* fill in the actual progress bar */ - str = str.replace(':bar', complete + incomplete); - /* replace the extra tokens */ - if (this.tokens) for (var key in this.tokens) str = str.replace(':' + key, this.tokens[key]); + if (!state.ending) endWritable(this, state, cb); + return this; +}; - if (this.lastDraw !== str) { - this.stream.cursorTo(0); - this.stream.write(str); - this.stream.clearLine(1); - this.lastDraw = str; +Object.defineProperty(Writable.prototype, 'writableLength', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; } -}; +}); -/** - * "update" the progress bar to represent an exact percentage. - * The ratio (between 0 and 1) specified will be multiplied by `total` and - * floored, representing the closest available "tick." For example, if a - * progress bar has a length of 3 and `update(0.5)` is called, the progress - * will be set to 1. - * - * A ratio of 0.5 will attempt to set the progress to halfway. - * - * @param {number} ratio The ratio (between 0 and 1 inclusive) to set the - * overall completion to. - * @api public - */ +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} -ProgressBar.prototype.update = function (ratio, tokens) { - var goal = Math.floor(ratio * this.total); - var delta = goal - this.curr; +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; - this.tick(delta, tokens); -}; + if (err) { + errorOrDestroy(stream, err); + } -/** - * "interrupt" the progress bar and write a message above it. - * @param {string} message The message to write. - * @api public - */ + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} -ProgressBar.prototype.interrupt = function (message) { - // clear the current line - this.stream.clearLine(); - // move the cursor to the start of the line - this.stream.cursorTo(0); - // write the message text - this.stream.write(message); - // terminate the line after writing the message - this.stream.write('\n'); - // re-display the progress bar with its lastDraw - this.stream.write(this.lastDraw); -}; +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function' && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} -/** - * Terminates a progress bar. - * - * @api public - */ +function finishMaybe(stream, state) { + var need = needFinish(state); -ProgressBar.prototype.terminate = function () { - if (this.clear) { - if (this.stream.clearLine) { - this.stream.clearLine(); - this.stream.cursorTo(0); + if (need) { + prefinish(stream, state); + + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + + if (state.autoDestroy) { + // In case of duplex streams we need a way to detect + // if the readable side is ready for autoDestroy as well + var rState = stream._readableState; + + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream.destroy(); + } + } } - } else { - this.stream.write('\n'); } -}; + return need; +} -/***/ }), +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); -/***/ 98051: -/***/ ((module) => { + if (cb) { + if (state.finished) process.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} -module.exports = ProtoList +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; -function setProto(obj, proto) { - if (typeof Object.setPrototypeOf === "function") - return Object.setPrototypeOf(obj, proto) - else - obj.__proto__ = proto -} + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } // reuse the free corkReq. -function ProtoList () { - this.list = [] - var root = null - Object.defineProperty(this, 'root', { - get: function () { return root }, - set: function (r) { - root = r - if (this.list.length) { - setProto(this.list[this.list.length - 1], r) - } - }, - enumerable: true, - configurable: true - }) + + state.corkedRequestsFree.next = corkReq; } -ProtoList.prototype = - { get length () { return this.list.length } - , get keys () { - var k = [] - for (var i in this.list[0]) k.push(i) - return k - } - , get snapshot () { - var o = {} - this.keys.forEach(function (k) { o[k] = this.get(k) }, this) - return o - } - , get store () { - return this.list[0] - } - , push : function (obj) { - if (typeof obj !== "object") obj = {valueOf:obj} - if (this.list.length >= 1) { - setProto(this.list[this.list.length - 1], obj) - } - setProto(obj, this.root) - return this.list.push(obj) - } - , pop : function () { - if (this.list.length >= 2) { - setProto(this.list[this.list.length - 2], this.root) - } - return this.list.pop() - } - , unshift : function (obj) { - setProto(obj, this.list[0] || this.root) - return this.list.unshift(obj) - } - , shift : function () { - if (this.list.length === 1) { - setProto(this.list[0], this.root) - } - return this.list.shift() - } - , get : function (key) { - return this.list[0][key] - } - , set : function (key, val, save) { - if (!this.length) this.push({}) - if (save && this.list[0].hasOwnProperty(key)) this.push({}) - return this.list[0][key] = val - } - , forEach : function (fn, thisp) { - for (var key in this.list[0]) fn.call(thisp, key, this.list[0][key]) - } - , slice : function () { - return this.list.slice.apply(this.list, arguments) - } - , splice : function () { - // handle injections - var ret = this.list.splice.apply(this.list, arguments) - for (var i = 0, l = this.list.length; i < l; i++) { - setProto(this.list[i], this.list[i + 1] || this.root) - } - return ret +Object.defineProperty(Writable.prototype, 'destroyed', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._writableState === undefined) { + return false; } + + return this._writableState.destroyed; + }, + set: function set(value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } // backward compatibility, the user is explicitly + // managing destroyed + + + this._writableState.destroyed = value; } +}); +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + cb(err); +}; /***/ }), -/***/ 20113: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 60863: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var once = __webpack_require__(96754) -var eos = __webpack_require__(11745) -var fs = __webpack_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes +"use strict"; -var noop = function () {} -var ancient = /^v?\.0/.test(process.version) -var isFn = function (fn) { - return typeof fn === 'function' +var _Object$setPrototypeO; + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var finished = __nccwpck_require__(22979); + +var kLastResolve = Symbol('lastResolve'); +var kLastReject = Symbol('lastReject'); +var kError = Symbol('error'); +var kEnded = Symbol('ended'); +var kLastPromise = Symbol('lastPromise'); +var kHandlePromise = Symbol('handlePromise'); +var kStream = Symbol('stream'); + +function createIterResult(value, done) { + return { + value: value, + done: done + }; } -var isFS = function (stream) { - if (!ancient) return false // newer node version do not need to care about fs is a special way - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +function readAndResolve(iter) { + var resolve = iter[kLastResolve]; + + if (resolve !== null) { + var data = iter[kStream].read(); // we defer if data is null + // we can be expecting either 'end' or + // 'error' + + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data, false)); + } + } } -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) +function onReadable(iter) { + // we wait for the next tick, because it might + // emit an error with process.nextTick + process.nextTick(readAndResolve, iter); } -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) +function wrapForNext(lastPromise, iter) { + return function (resolve, reject) { + lastPromise.then(function () { + if (iter[kEnded]) { + resolve(createIterResult(undefined, true)); + return; + } - var closed = false - stream.on('close', function () { - closed = true - }) + iter[kHandlePromise](resolve, reject); + }, reject); + }; +} - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) +var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); +var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true + next: function next() { + var _this = this; - if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want + // if we have detected an error in the meanwhile + // reject straight away + var error = this[kError]; - if (isFn(stream.destroy)) return stream.destroy() + if (error !== null) { + return Promise.reject(error); + } - callback(err || new Error('stream was destroyed')) - } -} + if (this[kEnded]) { + return Promise.resolve(createIterResult(undefined, true)); + } -var call = function (fn) { - fn() -} + if (this[kStream].destroyed) { + // We need to defer via nextTick because if .destroy(err) is + // called, the error will be emitted via nextTick, and + // we cannot guarantee that there is no error lingering around + // waiting to be emitted. + return new Promise(function (resolve, reject) { + process.nextTick(function () { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(undefined, true)); + } + }); + }); + } // if we have multiple next() calls + // we will wait for the previous Promise to finish + // this logic is optimized to support for await loops, + // where next() is only called once at a time -var pipe = function (from, to) { - return from.pipe(to) -} -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop + var lastPromise = this[kLastPromise]; + var promise; - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + // fast path needed to support multiple this.push() + // without triggering the next() queue + var data = this[kStream].read(); - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) + if (data !== null) { + return Promise.resolve(createIterResult(data, false)); + } - return streams.reduce(pipe) -} + promise = new Promise(this[kHandlePromise]); + } -module.exports = pump + this[kLastPromise] = promise; + return promise; + } +}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { + return this; +}), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + + // destroy(err, cb) is a private API + // we can guarantee we have that here, because we control the + // Readable class this is attached to + return new Promise(function (resolve, reject) { + _this2[kStream].destroy(null, function (err) { + if (err) { + reject(err); + return; + } + resolve(createIterResult(undefined, true)); + }); + }); +}), _Object$setPrototypeO), AsyncIteratorPrototype); + +var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { + var _Object$create; + + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data = iterator[kStream].read(); + + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream, function (err) { + if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { + var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise + // returned by next() and store the error + + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + + iterator[kError] = err; + return; + } -/***/ }), + var resolve = iterator[kLastResolve]; -/***/ 76671: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(undefined, true)); + } -"use strict"; + iterator[kEnded] = true; + }); + stream.on('readable', onReadable.bind(null, iterator)); + return iterator; +}; -var strictUriEncode = __webpack_require__(61778); -var objectAssign = __webpack_require__(14594); +module.exports = createReadableStreamAsyncIterator; -function encoderForArrayFormat(opts) { - switch (opts.arrayFormat) { - case 'index': - return function (key, value, index) { - return value === null ? [ - encode(key, opts), - '[', - index, - ']' - ].join('') : [ - encode(key, opts), - '[', - encode(index, opts), - ']=', - encode(value, opts) - ].join(''); - }; +/***/ }), - case 'bracket': - return function (key, value) { - return value === null ? encode(key, opts) : [ - encode(key, opts), - '[]=', - encode(value, opts) - ].join(''); - }; +/***/ 29464: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - default: - return function (key, value) { - return value === null ? encode(key, opts) : [ - encode(key, opts), - '=', - encode(value, opts) - ].join(''); - }; - } -} +"use strict"; -function parserForArrayFormat(opts) { - var result; - switch (opts.arrayFormat) { - case 'index': - return function (key, value, accumulator) { - result = /\[(\d*)\]$/.exec(key); +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - key = key.replace(/\[\d*\]$/, ''); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - if (!result) { - accumulator[key] = value; - return; - } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - if (accumulator[key] === undefined) { - accumulator[key] = {}; - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - accumulator[key][result[1]] = value; - }; +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - case 'bracket': - return function (key, value, accumulator) { - result = /(\[\])$/.exec(key); - key = key.replace(/\[\]$/, ''); +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - if (!result) { - accumulator[key] = value; - return; - } else if (accumulator[key] === undefined) { - accumulator[key] = [value]; - return; - } +var _require = __nccwpck_require__(64293), + Buffer = _require.Buffer; - accumulator[key] = [].concat(accumulator[key], value); - }; +var _require2 = __nccwpck_require__(31669), + inspect = _require2.inspect; - default: - return function (key, value, accumulator) { - if (accumulator[key] === undefined) { - accumulator[key] = value; - return; - } +var custom = inspect && inspect.custom || 'inspect'; - accumulator[key] = [].concat(accumulator[key], value); - }; - } +function copyBuffer(src, target, offset) { + Buffer.prototype.copy.call(src, target, offset); } -function encode(value, opts) { - if (opts.encode) { - return opts.strict ? strictUriEncode(value) : encodeURIComponent(value); - } +module.exports = +/*#__PURE__*/ +function () { + function BufferList() { + _classCallCheck(this, BufferList); - return value; -} + this.head = null; + this.tail = null; + this.length = 0; + } + + _createClass(BufferList, [{ + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null + }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; -function keysSorter(input) { - if (Array.isArray(input)) { - return input.sort(); - } else if (typeof input === 'object') { - return keysSorter(Object.keys(input)).sort(function (a, b) { - return Number(a) - Number(b); - }).map(function (key) { - return input[key]; - }); - } + while (p = p.next) { + ret += s + p.data; + } - return input; -} + return ret; + } + }, { + key: "concat", + value: function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; -exports.extract = function (str) { - return str.split('?')[1] || ''; -}; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } -exports.parse = function (str, opts) { - opts = objectAssign({arrayFormat: 'none'}, opts); + return ret; + } // Consumes a specified amount of bytes or characters from the buffered data. - var formatter = parserForArrayFormat(opts); + }, { + key: "consume", + value: function consume(n, hasStrings) { + var ret; + + if (n < this.head.data.length) { + // `slice` is the same for buffers and strings. + ret = this.head.data.slice(0, n); + this.head.data = this.head.data.slice(n); + } else if (n === this.head.data.length) { + // First chunk is a perfect match. + ret = this.shift(); + } else { + // Result spans more than one buffer. + ret = hasStrings ? this._getString(n) : this._getBuffer(n); + } - // Create an object with no prototype - // https://github.com/sindresorhus/query-string/issues/47 - var ret = Object.create(null); + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } // Consumes a specified amount of characters from the buffered data. - if (typeof str !== 'string') { - return ret; - } + }, { + key: "_getString", + value: function _getString(n) { + var p = this.head; + var c = 1; + var ret = p.data; + n -= ret.length; + + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = str.slice(nb); + } - str = str.trim().replace(/^(\?|#|&)/, ''); + break; + } - if (!str) { - return ret; - } + ++c; + } - str.split('&').forEach(function (param) { - var parts = param.replace(/\+/g, ' ').split('='); - // Firefox (pre 40) decodes `%3D` to `=` - // https://github.com/sindresorhus/query-string/pull/37 - var key = parts.shift(); - var val = parts.length > 0 ? parts.join('=') : undefined; + this.length -= c; + return ret; + } // Consumes a specified amount of bytes from the buffered data. - // missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeURIComponent(val); + }, { + key: "_getBuffer", + value: function _getBuffer(n) { + var ret = Buffer.allocUnsafe(n); + var p = this.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) this.head = p.next;else this.head = this.tail = null; + } else { + this.head = p; + p.data = buf.slice(nb); + } - formatter(decodeURIComponent(key), val, ret); - }); + break; + } - return Object.keys(ret).sort().reduce(function (result, key) { - var val = ret[key]; - if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) { - // Sort object keys, not values - result[key] = keysSorter(val); - } else { - result[key] = val; - } + ++c; + } - return result; - }, Object.create(null)); -}; + this.length -= c; + return ret; + } // Make sure the linked list only shows the minimal necessary information. -exports.stringify = function (obj, opts) { - var defaults = { - encode: true, - strict: true, - arrayFormat: 'none' - }; + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread({}, options, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); - opts = objectAssign(defaults, opts); + return BufferList; +}(); - var formatter = encoderForArrayFormat(opts); +/***/ }), - return obj ? Object.keys(obj).sort().map(function (key) { - var val = obj[key]; +/***/ 87915: +/***/ ((module) => { - if (val === undefined) { - return ''; - } +"use strict"; + // undocumented cb() API, needed for core, not for public API - if (val === null) { - return encode(key, opts); - } +function destroy(err, cb) { + var _this = this; - if (Array.isArray(val)) { - var result = []; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; - val.slice().forEach(function (val2) { - if (val2 === undefined) { - return; - } + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } - result.push(formatter(key, val2, result.length)); - }); + return this; + } // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks - return result.join('&'); - } - return encode(key, opts) + '=' + encode(val, opts); - }).filter(function (x) { - return x.length > 0; - }).join('&') : ''; -}; + if (this._readableState) { + this._readableState.destroyed = true; + } // if this is a duplex stream mark the writable part as destroyed as well -/***/ }), + if (this._writableState) { + this._writableState.destroyed = true; + } -/***/ 45730: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err); + } else { + process.nextTick(emitCloseNT, _this); + } + }); -"use strict"; + return this; +} -const path = __webpack_require__(85622); -const findUp = __webpack_require__(2885); -const readPkg = __webpack_require__(19003); +function emitErrorAndCloseNT(self, err) { + emitErrorNT(self, err); + emitCloseNT(self); +} -module.exports = async options => { - const filePath = await findUp('package.json', options); +function emitCloseNT(self) { + if (self._writableState && !self._writableState.emitClose) return; + if (self._readableState && !self._readableState.emitClose) return; + self.emit('close'); +} - if (!filePath) { - return; - } +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } - return { - packageJson: await readPkg({...options, cwd: path.dirname(filePath)}), - path: filePath - }; -}; + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} -module.exports.sync = options => { - const filePath = findUp.sync('package.json', options); +function emitErrorNT(self, err) { + self.emit('error', err); +} - if (!filePath) { - return; - } +function errorOrDestroy(stream, err) { + // We have tests that rely on errors being emitted + // in the same tick, so changing this is semver major. + // For now when you opt-in to autoDestroy we allow + // the error to be emitted nextTick. In a future + // semver major update we should change the default to this. + var rState = stream._readableState; + var wState = stream._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); +} - return { - packageJson: readPkg.sync({...options, cwd: path.dirname(filePath)}), - path: filePath - }; +module.exports = { + destroy: destroy, + undestroy: undestroy, + errorOrDestroy: errorOrDestroy }; - /***/ }), -/***/ 40349: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 22979: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; +// Ported from https://github.com/mafintosh/end-of-stream with +// permission from the author, Mathias Buus (@mafintosh). -const errorEx = __webpack_require__(98361); -const fallback = __webpack_require__(48335); -const {default: LinesAndColumns} = __webpack_require__(99036); -const {codeFrameColumns} = __webpack_require__(36553); - -const JSONError = errorEx('JSONError', { - fileName: errorEx.append('in %s'), - codeFrame: errorEx.append('\n\n%s\n') -}); - -module.exports = (string, reviver, filename) => { - if (typeof reviver === 'string') { - filename = reviver; - reviver = null; - } - - try { - try { - return JSON.parse(string, reviver); - } catch (error) { - fallback(string, reviver); - throw error; - } - } catch (error) { - error.message = error.message.replace(/\n/g, ''); - const indexMatch = error.message.match(/in JSON at position (\d+) while parsing near/); - - const jsonError = new JSONError(error); - if (filename) { - jsonError.fileName = filename; - } - if (indexMatch && indexMatch.length > 0) { - const lines = new LinesAndColumns(string); - const index = Number(indexMatch[1]); - const location = lines.locationForIndex(index); +var ERR_STREAM_PREMATURE_CLOSE = __nccwpck_require__(92036)/* .codes.ERR_STREAM_PREMATURE_CLOSE */ .q.ERR_STREAM_PREMATURE_CLOSE; - const codeFrame = codeFrameColumns( - string, - {start: {line: location.line + 1, column: location.column + 1}}, - {highlightCode: true} - ); +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; - jsonError.codeFrame = codeFrame; - } + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - throw jsonError; - } -}; + callback.apply(this, args); + }; +} +function noop() {} -/***/ }), +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +} -/***/ 19003: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +function eos(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop); + var readable = opts.readable || opts.readable !== false && stream.readable; + var writable = opts.writable || opts.writable !== false && stream.writable; -"use strict"; + var onlegacyfinish = function onlegacyfinish() { + if (!stream.writable) onfinish(); + }; -const {promisify} = __webpack_require__(31669); -const fs = __webpack_require__(35747); -const path = __webpack_require__(85622); -const parseJson = __webpack_require__(40349); + var writableEnded = stream._writableState && stream._writableState.finished; -const readFileAsync = promisify(fs.readFile); + var onfinish = function onfinish() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream); + }; -module.exports = async options => { - options = { - cwd: process.cwd(), - normalize: true, - ...options - }; + var readableEnded = stream._readableState && stream._readableState.endEmitted; - const filePath = path.resolve(options.cwd, 'package.json'); - const json = parseJson(await readFileAsync(filePath, 'utf8')); + var onend = function onend() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream); + }; - if (options.normalize) { - __webpack_require__(44586)(json); - } + var onerror = function onerror(err) { + callback.call(stream, err); + }; - return json; -}; + var onclose = function onclose() { + var err; -module.exports.sync = options => { - options = { - cwd: process.cwd(), - normalize: true, - ...options - }; + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } - const filePath = path.resolve(options.cwd, 'package.json'); - const json = parseJson(fs.readFileSync(filePath, 'utf8')); + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + }; - if (options.normalize) { - __webpack_require__(44586)(json); - } + var onrequest = function onrequest() { + stream.req.on('finish', onfinish); + }; - return json; -}; + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest();else stream.on('request', onrequest); + } else if (writable && !stream._writableState) { + // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + return function () { + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +} +module.exports = eos; /***/ }), -/***/ 20493: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 32244: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/*! - * resolve-dir - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -var path = __webpack_require__(85622); -var expand = __webpack_require__(3718); -var gm = __webpack_require__(6637); +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -module.exports = function resolveDir(dir) { - if (dir.charAt(0) === '~') { - dir = expand(dir); - } - if (dir.charAt(0) === '@') { - dir = path.join(gm, dir.slice(1)); - } - return dir; -}; +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } -/***/ }), +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -/***/ 6637: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var ERR_INVALID_ARG_TYPE = __nccwpck_require__(92036)/* .codes.ERR_INVALID_ARG_TYPE */ .q.ERR_INVALID_ARG_TYPE; -"use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); -/*! - * global-modules - * - * Copyright (c) 2015-2017 Jon Schlinkert. - * Licensed under the MIT license. - */ +function from(Readable, iterable, opts) { + var iterator; + if (iterable && typeof iterable.next === 'function') { + iterator = iterable; + } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); + var readable = new Readable(_objectSpread({ + objectMode: true + }, opts)); // Reading boolean to protect against _read + // being called before last iteration completion. -var path = __webpack_require__(85622); -var prefix = __webpack_require__(96397); -var isWindows = __webpack_require__(99333); -var gm; + var reading = false; -function getPath() { - if (isWindows()) { - return path.resolve(prefix, 'node_modules'); - } - return path.resolve(prefix, 'lib/node_modules'); -} + readable._read = function () { + if (!reading) { + reading = true; + next(); + } + }; -/** - * Expose `global-modules` path - */ + function next() { + return _next2.apply(this, arguments); + } -Object.defineProperty(module, 'exports', { - enumerable: true, - get: function() { - return gm || (gm = getPath()); + function _next2() { + _next2 = _asyncToGenerator(function* () { + try { + var _ref = yield iterator.next(), + value = _ref.value, + done = _ref.done; + + if (done) { + readable.push(null); + } else if (readable.push((yield value))) { + next(); + } else { + reading = false; + } + } catch (err) { + readable.destroy(err); + } + }); + return _next2.apply(this, arguments); } -}); + return readable; +} + +module.exports = from; /***/ }), -/***/ 96397: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ 25320: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/* module decorator */ module = __webpack_require__.nmd(module); -/*! - * global-prefix - * - * Copyright (c) 2015-2017 Jon Schlinkert. - * Licensed under the MIT license. - */ +// Ported from https://github.com/mafintosh/pump with +// permission from the author, Mathias Buus (@mafintosh). +var eos; -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var expand = __webpack_require__(3718); -var homedir = __webpack_require__(56530); -var ini = __webpack_require__(27452); -var prefix; +function once(callback) { + var called = false; + return function () { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; +} -function getPrefix() { - if (process.env.PREFIX) { - prefix = process.env.PREFIX; - } else { - // Start by checking if the global prefix is set by the user - var home = homedir(); - if (home) { - // homedir() returns undefined if $HOME not set; path.resolve requires strings - var userConfig = path.resolve(home, '.npmrc'); - prefix = tryConfigPath(userConfig); - } - - if (!prefix) { - // Otherwise find the path of npm - var npm = tryNpmPath(); - if (npm) { - // Check the built-in npm config file - var builtinConfig = path.resolve(npm, '..', '..', 'npmrc'); - prefix = tryConfigPath(builtinConfig); - - if (prefix) { - // Now the global npm config can also be checked. - var globalConfig = path.resolve(prefix, 'etc', 'npmrc'); - prefix = tryConfigPath(globalConfig) || prefix; - } - } +var _require$codes = __nccwpck_require__(92036)/* .codes */ .q, + ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, + ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - if (!prefix) fallback(); - } - } +function noop(err) { + // Rethrow the error if it exists to avoid swallowing it + if (err) throw err; +} - if (prefix) { - return expand(prefix); - } +function isRequest(stream) { + return stream.setHeader && typeof stream.abort === 'function'; } -function fallback() { - var isWindows = __webpack_require__(99333); - if (isWindows()) { - // c:\node\node.exe --> prefix=c:\node\ - prefix = process.env.APPDATA - ? path.join(process.env.APPDATA, 'npm') - : path.dirname(process.execPath); - } else { - // /usr/local/bin/node --> prefix=/usr/local - prefix = path.dirname(path.dirname(process.execPath)); +function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on('close', function () { + closed = true; + }); + if (eos === undefined) eos = __nccwpck_require__(22979); + eos(stream, { + readable: reading, + writable: writing + }, function (err) { + if (err) return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function (err) { + if (closed) return; + if (destroyed) return; + destroyed = true; // request.destroy just do .end - .abort is what we want - // destdir only is respected on Unix - if (process.env.DESTDIR) { - prefix = path.join(process.env.DESTDIR, prefix); - } - } + if (isRequest(stream)) return stream.abort(); + if (typeof stream.destroy === 'function') return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED('pipe')); + }; } -function tryNpmPath() { - try { - return fs.realpathSync(__webpack_require__(88291).sync('npm')); - } catch (err) {} - return null; +function call(fn) { + fn(); } -function tryConfigPath(configPath) { - try { - var data = fs.readFileSync(configPath, 'utf-8'); - var config = ini.parse(data); - if (config.prefix) return config.prefix; - } catch (err) {} - return null; +function pipe(from, to) { + return from.pipe(to); } -/** - * Expose `prefix` - */ +function popCallback(streams) { + if (!streams.length) return noop; + if (typeof streams[streams.length - 1] !== 'function') return noop; + return streams.pop(); +} -Object.defineProperty(module, 'exports', { - enumerable: true, - get: function() { - return prefix || (prefix = getPrefix()); +function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; } -}); - - -/***/ }), - -/***/ 88291: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = which -which.sync = whichSync -var isWindows = process.platform === 'win32' || - process.env.OSTYPE === 'cygwin' || - process.env.OSTYPE === 'msys' - -var path = __webpack_require__(85622) -var COLON = isWindows ? ';' : ':' -var isexe = __webpack_require__(52607) + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; -function getNotFoundError (cmd) { - var er = new Error('not found: ' + cmd) - er.code = 'ENOENT' + if (streams.length < 2) { + throw new ERR_MISSING_ARGS('streams'); + } - return er + var error; + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1; + var writing = i > 0; + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); } -function getPathInfo (cmd, opt) { - var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] +module.exports = pipeline; - pathEnv = pathEnv.split(colon) +/***/ }), - var pathExtExe = '' - if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') - pathExt = pathExtExe.split(colon) +/***/ 13400: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; - // Always test the cmd itself first. isexe will check to make sure - // it's found in the pathExt set. - if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') - pathExt.unshift('') - } - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) - pathEnv = [''] +var ERR_INVALID_OPT_VALUE = __nccwpck_require__(92036)/* .codes.ERR_INVALID_OPT_VALUE */ .q.ERR_INVALID_OPT_VALUE; - return { - env: pathEnv, - ext: pathExt, - extExe: pathExtExe - } +function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } -function which (cmd, opt, cb) { - if (typeof opt === 'function') { - cb = opt - opt = {} - } - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] +function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - ;(function F (i, l) { - if (i === l) { - if (opt.all && found.length) - return cb(null, found) - else - return cb(getNotFoundError(cmd)) + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : 'highWaterMark'; + throw new ERR_INVALID_OPT_VALUE(name, hwm); } - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) + return Math.floor(hwm); + } // Default value - var p = path.join(pathPart, cmd) - if (!pathPart && (/^\.[\\\/]/).test(cmd)) { - p = cmd.slice(0, 2) + p - } - ;(function E (ii, ll) { - if (ii === ll) return F(i + 1, l) - var ext = pathExt[ii] - isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { - if (!er && is) { - if (opt.all) - found.push(p + ext) - else - return cb(null, p + ext) - } - return E(ii + 1, ll) - }) - })(0, pathExt.length) - })(0, pathEnv.length) + + return state.objectMode ? 16 : 16 * 1024; } -function whichSync (cmd, opt) { - opt = opt || {} +module.exports = { + getHighWaterMark: getHighWaterMark +}; - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] +/***/ }), - for (var i = 0, l = pathEnv.length; i < l; i ++) { - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) +/***/ 1065: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var p = path.join(pathPart, cmd) - if (!pathPart && /^\.[\\\/]/.test(cmd)) { - p = cmd.slice(0, 2) + p - } - for (var j = 0, ll = pathExt.length; j < ll; j ++) { - var cur = p + pathExt[j] - var is - try { - is = isexe.sync(cur, { pathExt: pathExtExe }) - if (is) { - if (opt.all) - found.push(cur) - else - return cur - } - } catch (ex) {} - } - } +module.exports = __nccwpck_require__(92413); - if (opt.all && found.length) - return found - if (opt.nothrow) - return null +/***/ }), - throw getNotFoundError(cmd) +/***/ 68193: +/***/ ((module, exports, __nccwpck_require__) => { + +var Stream = __nccwpck_require__(92413); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream.Readable; + Object.assign(module.exports, Stream); + module.exports.Stream = Stream; +} else { + exports = module.exports = __nccwpck_require__(79341); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __nccwpck_require__(78063); + exports.Duplex = __nccwpck_require__(42770); + exports.Transform = __nccwpck_require__(62826); + exports.PassThrough = __nccwpck_require__(60143); + exports.finished = __nccwpck_require__(22979); + exports.pipeline = __nccwpck_require__(25320); } /***/ }), /***/ 72305: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var async = __webpack_require__(97801); -async.core = __webpack_require__(91540); -async.isCore = __webpack_require__(67069); -async.sync = __webpack_require__(57955); +var async = __nccwpck_require__(97801); +async.core = __nccwpck_require__(91540); +async.isCore = __nccwpck_require__(67069); +async.sync = __nccwpck_require__(57955); module.exports = async; @@ -86609,14 +73291,14 @@ module.exports = async; /***/ }), /***/ 97801: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var caller = __webpack_require__(14365); -var nodeModulesPaths = __webpack_require__(50833); -var normalizeOptions = __webpack_require__(98233); -var isCore = __webpack_require__(67069); +var fs = __nccwpck_require__(35747); +var path = __nccwpck_require__(85622); +var caller = __nccwpck_require__(14365); +var nodeModulesPaths = __nccwpck_require__(50833); +var normalizeOptions = __nccwpck_require__(98233); +var isCore = __nccwpck_require__(21176); var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; @@ -86686,6 +73368,7 @@ module.exports = function resolve(x, options, callback) { var packageIterator = opts.packageIterator; var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path.dirname(caller()); var parent = opts.filename || basedir; @@ -86712,7 +73395,7 @@ module.exports = function resolve(x, options, callback) { if ((/\/$/).test(x) && res === basedir) { loadAsDirectory(res, opts.package, onfile); } else loadAsFile(res, opts.package, onfile); - } else if (isCore(x)) { + } else if (includeCoreModules && isCore(x)) { return cb(null, x); } else loadNodeModules(x, basedir, function (err, n, pkg) { if (err) cb(err); @@ -86929,7 +73612,7 @@ module.exports = function () { /***/ }), /***/ 91540: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; @@ -86939,8 +73622,8 @@ function specifierIncluded(specifier) { var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); for (var i = 0; i < 3; ++i) { - var cur = Number(current[i] || 0); - var ver = Number(versionParts[i] || 0); + var cur = parseInt(current[i] || 0, 10); + var ver = parseInt(versionParts[i] || 0, 10); if (cur === ver) { continue; // eslint-disable-line no-restricted-syntax, no-continue } @@ -86975,7 +73658,7 @@ function versionIncluded(specifierValue) { return matchesRange(specifierValue); } -var data = __webpack_require__(52538); +var data = __nccwpck_require__(52538); var core = {}; for (var mod in data) { // eslint-disable-line no-restricted-syntax @@ -86989,22 +73672,22 @@ module.exports = core; /***/ }), /***/ 67069: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var core = __webpack_require__(91540); +var isCoreModule = __nccwpck_require__(21176); module.exports = function isCore(x) { - return Object.prototype.hasOwnProperty.call(core, x); + return isCoreModule(x); }; /***/ }), /***/ 50833: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var path = __webpack_require__(85622); -var parse = path.parse || __webpack_require__(50731); +var path = __nccwpck_require__(85622); +var parse = path.parse || __nccwpck_require__(50731); var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { var prefix = '/'; @@ -87067,14 +73750,14 @@ module.exports = function (x, opts) { /***/ }), /***/ 57955: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var isCore = __webpack_require__(67069); -var fs = __webpack_require__(35747); -var path = __webpack_require__(85622); -var caller = __webpack_require__(14365); -var nodeModulesPaths = __webpack_require__(50833); -var normalizeOptions = __webpack_require__(98233); +var isCore = __nccwpck_require__(21176); +var fs = __nccwpck_require__(35747); +var path = __nccwpck_require__(85622); +var caller = __nccwpck_require__(14365); +var nodeModulesPaths = __nccwpck_require__(50833); +var normalizeOptions = __nccwpck_require__(98233); var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; @@ -87137,6 +73820,7 @@ module.exports = function resolveSync(x, options) { var packageIterator = opts.packageIterator; var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path.dirname(caller()); var parent = opts.filename || basedir; @@ -87150,7 +73834,7 @@ module.exports = function resolveSync(x, options) { if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; var m = loadAsFileSync(res) || loadAsDirectorySync(res); if (m) return maybeRealpathSync(realpathSync, m, opts); - } else if (isCore(x)) { + } else if (includeCoreModules && isCore(x)) { return x; } else { var n = loadNodeModulesSync(x, absoluteStart); @@ -87265,13 +73949,13 @@ module.exports = function resolveSync(x, options) { /***/ }), /***/ 39014: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Readable = __webpack_require__(92413).Readable; -const lowercaseKeys = __webpack_require__(18984); +const Readable = __nccwpck_require__(92413).Readable; +const lowercaseKeys = __nccwpck_require__(18984); class Response extends Readable { constructor(statusCode, headers, body, url) { @@ -87304,6 +73988,285 @@ class Response extends Readable { module.exports = Response; +/***/ }), + +/***/ 59454: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(1839); + +/***/ }), + +/***/ 1839: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var RetryOperation = __nccwpck_require__(8730); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref, + maxRetryTime: options && options.maxRetryTime + }); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper(original) { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments, 1); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }.bind(obj, original); + obj[method].options = options; + } +}; + + +/***/ }), + +/***/ 8730: +/***/ ((module) => { + +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + + this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); + this._timeouts = timeouts; + this._options = options || {}; + this._maxRetryTime = options && options.maxRetryTime || Infinity; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + this._operationStart = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.reset = function() { + this._attempts = 1; + this._timeouts = this._originalTimeouts; +} + +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + var currentTime = new Date().getTime(); + if (err && currentTime - this._operationStart >= this._maxRetryTime) { + this._errors.unshift(new Error('RetryOperation timeout occurred')); + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(this._errors.length - 1, this._errors.length); + this._timeouts = this._cachedTimeouts.slice(0); + timeout = this._timeouts.shift(); + } else { + return false; + } + } + + var self = this; + var timer = setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + + if (self._options.unref) { + self._timeout.unref(); + } + } + + self._fn(self._attempts); + }, timeout); + + if (this._options.unref) { + timer.unref(); + } + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._operationStart = new Date().getTime(); + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; + + /***/ }), /***/ 17352: @@ -87330,7 +74293,7 @@ exports.logLevels = logLevels; /***/ }), /***/ 57109: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87340,18 +74303,20 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _globalthis = _interopRequireDefault(__webpack_require__(35553)); +var _detectNode = _interopRequireDefault(__nccwpck_require__(7192)); -var _detectNode = _interopRequireDefault(__webpack_require__(7192)); +var _globalthis = _interopRequireDefault(__nccwpck_require__(35553)); -var _jsonStringifySafe = _interopRequireDefault(__webpack_require__(4211)); +var _jsonStringifySafe = _interopRequireDefault(__nccwpck_require__(4211)); -var _sprintfJs = __webpack_require__(74273); +var _sprintfJs = __nccwpck_require__(14792); -var _constants = __webpack_require__(17352); +var _constants = __nccwpck_require__(17352); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } @@ -87363,7 +74328,7 @@ let domain; if (_detectNode.default) { // eslint-disable-next-line global-require - domain = __webpack_require__(85229); + domain = __nccwpck_require__(85229); } const getParentDomainContext = () => { @@ -87389,7 +74354,7 @@ const getParentDomainContext = () => { let domainContext = {}; for (const parentRoarrContext of parentRoarrContexts) { - domainContext = _objectSpread({}, domainContext, {}, parentRoarrContext); + domainContext = _objectSpread(_objectSpread({}, domainContext), parentRoarrContext); } return domainContext; @@ -87431,14 +74396,36 @@ const createLogger = (onMessage, parentContext) => { let message; if (typeof a === 'string') { - context = _objectSpread({}, getFirstParentDomainContext(), {}, parentContext || {}); - message = (0, _sprintfJs.sprintf)(a, b, c, d, e, f, g, h, i, k); + context = _objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}); // eslint-disable-next-line id-length, object-property-newline + + const args = _extends({}, { + a, + b, + c, + d, + e, + f, + g, + h, + i, + k + }); + + const values = Object.keys(args).map(key => { + return args[key]; + }); // eslint-disable-next-line unicorn/no-reduce + + const hasOnlyOneParameterValued = 1 === values.reduce((accumulator, value) => { + // eslint-disable-next-line no-return-assign, no-param-reassign + return accumulator += typeof value === 'undefined' ? 0 : 1; + }, 0); + message = hasOnlyOneParameterValued ? (0, _sprintfJs.sprintf)('%s', a) : (0, _sprintfJs.sprintf)(a, b, c, d, e, f, g, h, i, k); } else { if (typeof b !== 'string') { throw new TypeError('Message must be a string.'); } - context = JSON.parse((0, _jsonStringifySafe.default)(_objectSpread({}, getFirstParentDomainContext(), {}, parentContext || {}, {}, a))); + context = JSON.parse((0, _jsonStringifySafe.default)(_objectSpread(_objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}), a))); message = (0, _sprintfJs.sprintf)(b, c, d, e, f, g, h, i, k); } @@ -87462,11 +74449,11 @@ const createLogger = (onMessage, parentContext) => { }, parentContext); } - return createLogger(onMessage, _objectSpread({}, getFirstParentDomainContext(), {}, parentContext, {}, context)); + return createLogger(onMessage, _objectSpread(_objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext), context)); }; log.getContext = () => { - return _objectSpread({}, getFirstParentDomainContext(), {}, parentContext || {}); + return _objectSpread(_objectSpread({}, getFirstParentDomainContext()), parentContext || {}); }; log.adopt = async (routine, context) => { @@ -87478,7 +74465,7 @@ const createLogger = (onMessage, parentContext) => { return adoptedDomain.run(() => { // $FlowFixMe adoptedDomain.roarr = { - context: _objectSpread({}, getParentDomainContext(), {}, context) + context: _objectSpread(_objectSpread({}, getParentDomainContext()), context) }; return routine(); }); @@ -87505,7 +74492,7 @@ exports.default = _default; /***/ }), /***/ 78539: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87515,7 +74502,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _constants = __webpack_require__(17352); +var _constants = __nccwpck_require__(17352); const createMockLogger = (onMessage, parentContext) => { // eslint-disable-next-line id-length, unicorn/prevent-abbreviations, no-unused-vars @@ -87588,7 +74575,7 @@ exports.default = _default; /***/ }), /***/ 403: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87598,13 +74585,13 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.default = void 0; -var _semverCompare = _interopRequireDefault(__webpack_require__(61413)); +var _detectNode = _interopRequireDefault(__nccwpck_require__(7192)); -var _detectNode = _interopRequireDefault(__webpack_require__(7192)); +var _semverCompare = _interopRequireDefault(__nccwpck_require__(61413)); -var _package = __webpack_require__(40695); +var _package = __nccwpck_require__(40695); -var _createNodeWriter = _interopRequireDefault(__webpack_require__(19112)); +var _createNodeWriter = _interopRequireDefault(__nccwpck_require__(19112)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -87626,15 +74613,15 @@ const createRoarrInititialGlobalState = currentState => { versions.sort(_semverCompare.default); - let newState = _objectSpread({ + let newState = _objectSpread(_objectSpread({ sequence: 0 - }, currentState, { + }, currentState), {}, { versions }); if (_detectNode.default) { if (currentIsLatestVersion || !newState.write) { - newState = _objectSpread({}, newState, {}, (0, _createNodeWriter.default)()); + newState = _objectSpread(_objectSpread({}, newState), (0, _createNodeWriter.default)()); } } @@ -87648,7 +74635,7 @@ exports.default = _default; /***/ }), /***/ 4627: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87675,11 +74662,11 @@ Object.defineProperty(exports, "createRoarrInititialGlobalState", ({ } })); -var _createLogger = _interopRequireDefault(__webpack_require__(57109)); +var _createLogger = _interopRequireDefault(__nccwpck_require__(57109)); -var _createMockLogger = _interopRequireDefault(__webpack_require__(78539)); +var _createMockLogger = _interopRequireDefault(__nccwpck_require__(78539)); -var _createRoarrInititialGlobalState = _interopRequireDefault(__webpack_require__(403)); +var _createRoarrInititialGlobalState = _interopRequireDefault(__nccwpck_require__(403)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map @@ -87687,7 +74674,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /***/ }), /***/ 30786: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -87695,20 +74682,21 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.default = void 0; +exports.default = exports.ROARR = void 0; -var _boolean = __webpack_require__(8436); +var _boolean = __nccwpck_require__(8436); -var _globalthis = _interopRequireDefault(__webpack_require__(35553)); +var _detectNode = _interopRequireDefault(__nccwpck_require__(7192)); -var _detectNode = _interopRequireDefault(__webpack_require__(7192)); +var _globalthis = _interopRequireDefault(__nccwpck_require__(35553)); -var _factories = __webpack_require__(4627); +var _factories = __nccwpck_require__(4627); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const globalThis = (0, _globalthis.default)(); -globalThis.ROARR = (0, _factories.createRoarrInititialGlobalState)(globalThis.ROARR || {}); +const ROARR = globalThis.ROARR = (0, _factories.createRoarrInititialGlobalState)(globalThis.ROARR || {}); +exports.ROARR = ROARR; let logFactory = _factories.createLogger; if (_detectNode.default) { @@ -87721,28 +74709,266 @@ if (_detectNode.default) { } var _default = logFactory(message => { - if (globalThis.ROARR.write) { + if (ROARR.write) { // Stringify message as soon as it is received to prevent // properties of the context from being modified by reference. const body = JSON.stringify(message); - globalThis.ROARR.write(body); + ROARR.write(body); } }); exports.default = _default; //# sourceMappingURL=log.js.map +/***/ }), + +/***/ 14792: +/***/ ((__unused_webpack_module, exports) => { + +/* global window, exports, define */ + +!function() { + 'use strict' + + var re = { + not_string: /[^s]/, + not_bool: /[^t]/, + not_type: /[^T]/, + not_primitive: /[^v]/, + number: /[diefg]/, + numeric_arg: /[bcdiefguxX]/, + json: /[j]/, + not_json: /[^j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, + key: /^([a-z_][a-z_\d]*)/i, + key_access: /^\.([a-z_][a-z_\d]*)/i, + index_access: /^\[(\d+)\]/, + sign: /^[+-]/ + } + + function sprintf(key) { + // `arguments` is not an array, but should be fine for this call + return sprintf_format(sprintf_parse(key), arguments) + } + + function vsprintf(fmt, argv) { + return sprintf.apply(null, [fmt].concat(argv || [])) + } + + function sprintf_format(parse_tree, argv) { + var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign + for (i = 0; i < tree_length; i++) { + if (typeof parse_tree[i] === 'string') { + output += parse_tree[i] + } + else if (typeof parse_tree[i] === 'object') { + ph = parse_tree[i] // convenience purposes only + if (ph.keys) { // keyword argument + arg = argv[cursor] + for (k = 0; k < ph.keys.length; k++) { + if (arg == undefined) { + throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1])) + } + arg = arg[ph.keys[k]] + } + } + else if (ph.param_no) { // positional argument (explicit) + arg = argv[ph.param_no] + } + else { // positional argument (implicit) + arg = argv[cursor++] + } + + if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) { + arg = arg() + } + + if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) { + throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)) + } + + if (re.number.test(ph.type)) { + is_positive = arg >= 0 + } + + switch (ph.type) { + case 'b': + arg = parseInt(arg, 10).toString(2) + break + case 'c': + arg = String.fromCharCode(parseInt(arg, 10)) + break + case 'd': + case 'i': + arg = parseInt(arg, 10) + break + case 'j': + arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0) + break + case 'e': + arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential() + break + case 'f': + arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg) + break + case 'g': + arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg) + break + case 'o': + arg = (parseInt(arg, 10) >>> 0).toString(8) + break + case 's': + arg = String(arg) + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 't': + arg = String(!!arg) + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'T': + arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase() + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'u': + arg = parseInt(arg, 10) >>> 0 + break + case 'v': + arg = arg.valueOf() + arg = (ph.precision ? arg.substring(0, ph.precision) : arg) + break + case 'x': + arg = (parseInt(arg, 10) >>> 0).toString(16) + break + case 'X': + arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase() + break + } + if (re.json.test(ph.type)) { + output += arg + } + else { + if (re.number.test(ph.type) && (!is_positive || ph.sign)) { + sign = is_positive ? '+' : '-' + arg = arg.toString().replace(re.sign, '') + } + else { + sign = '' + } + pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ' + pad_length = ph.width - (sign + arg).length + pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : '' + output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg) + } + } + } + return output + } + + var sprintf_cache = Object.create(null) + + function sprintf_parse(fmt) { + if (sprintf_cache[fmt]) { + return sprintf_cache[fmt] + } + + var _fmt = fmt, match, parse_tree = [], arg_names = 0 + while (_fmt) { + if ((match = re.text.exec(_fmt)) !== null) { + parse_tree.push(match[0]) + } + else if ((match = re.modulo.exec(_fmt)) !== null) { + parse_tree.push('%') + } + else if ((match = re.placeholder.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1 + var field_list = [], replacement_field = match[2], field_match = [] + if ((field_match = re.key.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { + if ((field_match = re.key_access.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + } + else if ((field_match = re.index_access.exec(replacement_field)) !== null) { + field_list.push(field_match[1]) + } + else { + throw new SyntaxError('[sprintf] failed to parse named argument key') + } + } + } + else { + throw new SyntaxError('[sprintf] failed to parse named argument key') + } + match[2] = field_list + } + else { + arg_names |= 2 + } + if (arg_names === 3) { + throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported') + } + + parse_tree.push( + { + placeholder: match[0], + param_no: match[1], + keys: match[2], + sign: match[3], + pad_char: match[4], + align: match[5], + width: match[6], + precision: match[7], + type: match[8] + } + ) + } + else { + throw new SyntaxError('[sprintf] unexpected placeholder') + } + _fmt = _fmt.substring(match[0].length) + } + return sprintf_cache[fmt] = parse_tree + } + + /** + * export to either browser or node.js + */ + /* eslint-disable quote-props */ + if (true) { + exports.sprintf = sprintf + exports.vsprintf = vsprintf + } + if (typeof window !== 'undefined') { + window['sprintf'] = sprintf + window['vsprintf'] = vsprintf + + if (typeof define === 'function' && define['amd']) { + define(function() { + return { + 'sprintf': sprintf, + 'vsprintf': vsprintf + } + }) + } + } + /* eslint-enable quote-props */ +}(); // eslint-disable-line + + /***/ }), /***/ 52340: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* eslint-disable node/no-deprecated-api */ -var buffer = __webpack_require__(64293) +var buffer = __nccwpck_require__(64293) var Buffer = buffer.Buffer var safer = {} @@ -87817,73 +75043,6 @@ if (!safer.constants) { module.exports = safer -/***/ }), - -/***/ 22752: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/*jshint node:true*/ - - -/** - * Replaces characters in strings that are illegal/unsafe for filenames. - * Unsafe characters are either removed or replaced by a substitute set - * in the optional `options` object. - * - * Illegal Characters on Various Operating Systems - * / ? < > \ : * | " - * https://kb.acronis.com/content/39790 - * - * Unicode Control codes - * C0 0x00-0x1f & C1 (0x80-0x9f) - * http://en.wikipedia.org/wiki/C0_and_C1_control_codes - * - * Reserved filenames on Unix-based systems (".", "..") - * Reserved filenames in Windows ("CON", "PRN", "AUX", "NUL", "COM1", - * "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", - * "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", and - * "LPT9") case-insesitively and with or without filename extensions. - * - * Capped at 255 characters in length. - * http://unix.stackexchange.com/questions/32795/what-is-the-maximum-allowed-filename-and-folder-size-with-ecryptfs - * - * @param {String} input Original filename - * @param {Object} options {replacement: String | Function } - * @return {String} Sanitized filename - */ - -var truncate = __webpack_require__(81786); - -var illegalRe = /[\/\?<>\\:\*\|"]/g; -var controlRe = /[\x00-\x1f\x80-\x9f]/g; -var reservedRe = /^\.+$/; -var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i; -var windowsTrailingRe = /[\. ]+$/; - -function sanitize(input, replacement) { - if (typeof input !== 'string') { - throw new Error('Input must be string'); - } - var sanitized = input - .replace(illegalRe, replacement) - .replace(controlRe, replacement) - .replace(reservedRe, replacement) - .replace(windowsReservedRe, replacement) - .replace(windowsTrailingRe, replacement); - return truncate(sanitized, 255); -} - -module.exports = function (input, options) { - var replacement = (options && options.replacement) || ''; - var output = sanitize(input, replacement); - if (replacement === '') { - return output; - } - return sanitize(output, ''); -}; - - /***/ }), /***/ 61413: @@ -87907,7 +75066,7 @@ module.exports = function cmp (a, b) { /***/ }), /***/ 34777: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency @@ -87916,12 +75075,7 @@ class Comparator { return ANY } constructor (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { @@ -88043,27 +75197,23 @@ class Comparator { module.exports = Comparator -const {re, t} = __webpack_require__(64841) -const cmp = __webpack_require__(71128) -const debug = __webpack_require__(15909) -const SemVer = __webpack_require__(95271) -const Range = __webpack_require__(45636) +const parseOptions = __nccwpck_require__(5748) +const {re, t} = __nccwpck_require__(64841) +const cmp = __nccwpck_require__(71128) +const debug = __nccwpck_require__(15909) +const SemVer = __nccwpck_require__(95271) +const Range = __nccwpck_require__(45636) /***/ }), /***/ 45636: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // hoisted class for cyclic dependency class Range { constructor (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + options = parseOptions(options) if (range instanceof Range) { if ( @@ -88103,6 +75253,24 @@ class Range { throw new TypeError(`Invalid SemVer Range: ${range}`) } + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) + this.set = [first] + else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + this.format() } @@ -88121,8 +75289,17 @@ class Range { } parseRange (range) { - const loose = this.options.loose range = range.trim() + + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = Object.keys(this.options).join(',') + const memoKey = `parseRange:${memoOpts}:${range}` + const cached = cache.get(memoKey) + if (cached) + return cached + + const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) @@ -88144,15 +75321,33 @@ class Range { // ready to be split into comparators. const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - return range + const rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) + // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) // in loose mode, throw out any that are not valid comparators .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) .map(comp => new Comparator(comp, this.options)) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const l = rangeList.length + const rangeMap = new Map() + for (const comp of rangeList) { + if (isNullSet(comp)) + return [comp] + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) + rangeMap.delete('') + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result } intersects (range, options) { @@ -88201,16 +75396,23 @@ class Range { } module.exports = Range -const Comparator = __webpack_require__(34777) -const debug = __webpack_require__(15909) -const SemVer = __webpack_require__(95271) +const LRU = __nccwpck_require__(85069) +const cache = new LRU({ max: 1000 }) + +const parseOptions = __nccwpck_require__(5748) +const Comparator = __nccwpck_require__(34777) +const debug = __nccwpck_require__(15909) +const SemVer = __nccwpck_require__(95271) const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace -} = __webpack_require__(64841) +} = __nccwpck_require__(64841) + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' // take a set of comparators and determine whether there // exists a version which can satisfy it @@ -88523,21 +75725,18 @@ const testSet = (set, version, options) => { /***/ }), /***/ 95271: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const debug = __webpack_require__(15909) -const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(57549) -const { re, t } = __webpack_require__(64841) +const debug = __nccwpck_require__(15909) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(57549) +const { re, t } = __nccwpck_require__(64841) -const { compareIdentifiers } = __webpack_require__(7675) +const parseOptions = __nccwpck_require__(5748) +const { compareIdentifiers } = __nccwpck_require__(7675) class SemVer { constructor (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + options = parseOptions(options) + if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { @@ -88820,9 +76019,9 @@ module.exports = SemVer /***/ }), /***/ 65271: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parse = __webpack_require__(60663) +const parse = __nccwpck_require__(60663) const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null @@ -88833,14 +76032,14 @@ module.exports = clean /***/ }), /***/ 71128: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const eq = __webpack_require__(89348) -const neq = __webpack_require__(33678) -const gt = __webpack_require__(20209) -const gte = __webpack_require__(68758) -const lt = __webpack_require__(86197) -const lte = __webpack_require__(16768) +const eq = __nccwpck_require__(89348) +const neq = __nccwpck_require__(33678) +const gt = __nccwpck_require__(20209) +const gte = __nccwpck_require__(68758) +const lt = __nccwpck_require__(86197) +const lte = __nccwpck_require__(16768) const cmp = (a, op, b, loose) => { switch (op) { @@ -88888,11 +76087,11 @@ module.exports = cmp /***/ }), /***/ 51194: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const parse = __webpack_require__(60663) -const {re, t} = __webpack_require__(64841) +const SemVer = __nccwpck_require__(95271) +const parse = __nccwpck_require__(60663) +const {re, t} = __nccwpck_require__(64841) const coerce = (version, options) => { if (version instanceof SemVer) { @@ -88946,9 +76145,9 @@ module.exports = coerce /***/ }), /***/ 86587: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) @@ -88960,9 +76159,9 @@ module.exports = compareBuild /***/ }), /***/ 43525: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose @@ -88970,9 +76169,9 @@ module.exports = compareLoose /***/ }), /***/ 23681: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) @@ -88982,10 +76181,10 @@ module.exports = compare /***/ }), /***/ 16893: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parse = __webpack_require__(60663) -const eq = __webpack_require__(89348) +const parse = __nccwpck_require__(60663) +const eq = __nccwpck_require__(89348) const diff = (version1, version2) => { if (eq(version1, version2)) { @@ -89012,9 +76211,9 @@ module.exports = diff /***/ }), /***/ 89348: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq @@ -89022,9 +76221,9 @@ module.exports = eq /***/ }), /***/ 20209: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt @@ -89032,9 +76231,9 @@ module.exports = gt /***/ }), /***/ 68758: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte @@ -89042,9 +76241,9 @@ module.exports = gte /***/ }), /***/ 98039: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { @@ -89064,9 +76263,9 @@ module.exports = inc /***/ }), /***/ 86197: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt @@ -89074,9 +76273,9 @@ module.exports = lt /***/ }), /***/ 16768: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte @@ -89084,9 +76283,9 @@ module.exports = lte /***/ }), /***/ 70672: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const major = (a, loose) => new SemVer(a, loose).major module.exports = major @@ -89094,9 +76293,9 @@ module.exports = major /***/ }), /***/ 895: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor @@ -89104,9 +76303,9 @@ module.exports = minor /***/ }), /***/ 33678: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq @@ -89114,19 +76313,15 @@ module.exports = neq /***/ }), /***/ 60663: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const {MAX_LENGTH} = __webpack_require__(57549) -const { re, t } = __webpack_require__(64841) -const SemVer = __webpack_require__(95271) +const {MAX_LENGTH} = __nccwpck_require__(57549) +const { re, t } = __nccwpck_require__(64841) +const SemVer = __nccwpck_require__(95271) +const parseOptions = __nccwpck_require__(5748) const parse = (version, options) => { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + options = parseOptions(options) if (version instanceof SemVer) { return version @@ -89158,9 +76353,9 @@ module.exports = parse /***/ }), /***/ 10561: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) +const SemVer = __nccwpck_require__(95271) const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch @@ -89168,9 +76363,9 @@ module.exports = patch /***/ }), /***/ 83545: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parse = __webpack_require__(60663) +const parse = __nccwpck_require__(60663) const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null @@ -89181,9 +76376,9 @@ module.exports = prerelease /***/ }), /***/ 7980: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compare = __webpack_require__(23681) +const compare = __nccwpck_require__(23681) const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare @@ -89191,9 +76386,9 @@ module.exports = rcompare /***/ }), /***/ 17796: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compareBuild = __webpack_require__(86587) +const compareBuild = __nccwpck_require__(86587) const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort @@ -89201,9 +76396,9 @@ module.exports = rsort /***/ }), /***/ 60822: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) +const Range = __nccwpck_require__(45636) const satisfies = (version, range, options) => { try { range = new Range(range, options) @@ -89218,9 +76413,9 @@ module.exports = satisfies /***/ }), /***/ 62000: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const compareBuild = __webpack_require__(86587) +const compareBuild = __nccwpck_require__(86587) const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort @@ -89228,9 +76423,9 @@ module.exports = sort /***/ }), /***/ 36312: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parse = __webpack_require__(60663) +const parse = __nccwpck_require__(60663) const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null @@ -89241,55 +76436,55 @@ module.exports = valid /***/ }), /***/ 19618: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // just pre-load all the stuff that index.js lazily exports -const internalRe = __webpack_require__(64841) +const internalRe = __nccwpck_require__(64841) module.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, - SEMVER_SPEC_VERSION: __webpack_require__(57549).SEMVER_SPEC_VERSION, - SemVer: __webpack_require__(95271), - compareIdentifiers: __webpack_require__(7675).compareIdentifiers, - rcompareIdentifiers: __webpack_require__(7675).rcompareIdentifiers, - parse: __webpack_require__(60663), - valid: __webpack_require__(36312), - clean: __webpack_require__(65271), - inc: __webpack_require__(98039), - diff: __webpack_require__(16893), - major: __webpack_require__(70672), - minor: __webpack_require__(895), - patch: __webpack_require__(10561), - prerelease: __webpack_require__(83545), - compare: __webpack_require__(23681), - rcompare: __webpack_require__(7980), - compareLoose: __webpack_require__(43525), - compareBuild: __webpack_require__(86587), - sort: __webpack_require__(62000), - rsort: __webpack_require__(17796), - gt: __webpack_require__(20209), - lt: __webpack_require__(86197), - eq: __webpack_require__(89348), - neq: __webpack_require__(33678), - gte: __webpack_require__(68758), - lte: __webpack_require__(16768), - cmp: __webpack_require__(71128), - coerce: __webpack_require__(51194), - Comparator: __webpack_require__(34777), - Range: __webpack_require__(45636), - satisfies: __webpack_require__(60822), - toComparators: __webpack_require__(2959), - maxSatisfying: __webpack_require__(48180), - minSatisfying: __webpack_require__(21448), - minVersion: __webpack_require__(76368), - validRange: __webpack_require__(87472), - outside: __webpack_require__(40332), - gtr: __webpack_require__(37284), - ltr: __webpack_require__(97777), - intersects: __webpack_require__(3624), - simplifyRange: __webpack_require__(67251), - subset: __webpack_require__(41455), + SEMVER_SPEC_VERSION: __nccwpck_require__(57549).SEMVER_SPEC_VERSION, + SemVer: __nccwpck_require__(95271), + compareIdentifiers: __nccwpck_require__(7675).compareIdentifiers, + rcompareIdentifiers: __nccwpck_require__(7675).rcompareIdentifiers, + parse: __nccwpck_require__(60663), + valid: __nccwpck_require__(36312), + clean: __nccwpck_require__(65271), + inc: __nccwpck_require__(98039), + diff: __nccwpck_require__(16893), + major: __nccwpck_require__(70672), + minor: __nccwpck_require__(895), + patch: __nccwpck_require__(10561), + prerelease: __nccwpck_require__(83545), + compare: __nccwpck_require__(23681), + rcompare: __nccwpck_require__(7980), + compareLoose: __nccwpck_require__(43525), + compareBuild: __nccwpck_require__(86587), + sort: __nccwpck_require__(62000), + rsort: __nccwpck_require__(17796), + gt: __nccwpck_require__(20209), + lt: __nccwpck_require__(86197), + eq: __nccwpck_require__(89348), + neq: __nccwpck_require__(33678), + gte: __nccwpck_require__(68758), + lte: __nccwpck_require__(16768), + cmp: __nccwpck_require__(71128), + coerce: __nccwpck_require__(51194), + Comparator: __nccwpck_require__(34777), + Range: __nccwpck_require__(45636), + satisfies: __nccwpck_require__(60822), + toComparators: __nccwpck_require__(2959), + maxSatisfying: __nccwpck_require__(48180), + minSatisfying: __nccwpck_require__(21448), + minVersion: __nccwpck_require__(76368), + validRange: __nccwpck_require__(87472), + outside: __nccwpck_require__(40332), + gtr: __nccwpck_require__(37284), + ltr: __nccwpck_require__(97777), + intersects: __nccwpck_require__(3624), + simplifyRange: __nccwpck_require__(67251), + subset: __nccwpck_require__(41455), } @@ -89363,13 +76558,31 @@ module.exports = { } +/***/ }), + +/***/ 5748: +/***/ ((module) => { + +// parse out just the options we care about so we always get a consistent +// obj with keys in a consistent order. +const opts = ['includePrerelease', 'loose', 'rtl'] +const parseOptions = options => + !options ? {} + : typeof options !== 'object' ? { loose: true } + : opts.filter(k => options[k]).reduce((options, k) => { + options[k] = true + return options + }, {}) +module.exports = parseOptions + + /***/ }), /***/ 64841: -/***/ ((module, exports, __webpack_require__) => { +/***/ ((module, exports, __nccwpck_require__) => { -const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(57549) -const debug = __webpack_require__(15909) +const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(57549) +const debug = __nccwpck_require__(15909) exports = module.exports = {} // The actual regexps go on exports.re @@ -89555,10 +76768,10 @@ createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') /***/ }), /***/ 37284: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Determine if version is greater than all the versions possible in the range. -const outside = __webpack_require__(40332) +const outside = __nccwpck_require__(40332) const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr @@ -89566,9 +76779,9 @@ module.exports = gtr /***/ }), /***/ 3624: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) +const Range = __nccwpck_require__(45636) const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) @@ -89580,9 +76793,9 @@ module.exports = intersects /***/ }), /***/ 97777: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const outside = __webpack_require__(40332) +const outside = __nccwpck_require__(40332) // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr @@ -89591,10 +76804,10 @@ module.exports = ltr /***/ }), /***/ 48180: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const Range = __webpack_require__(45636) +const SemVer = __nccwpck_require__(95271) +const Range = __nccwpck_require__(45636) const maxSatisfying = (versions, range, options) => { let max = null @@ -89623,10 +76836,10 @@ module.exports = maxSatisfying /***/ }), /***/ 21448: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const Range = __webpack_require__(45636) +const SemVer = __nccwpck_require__(95271) +const Range = __nccwpck_require__(45636) const minSatisfying = (versions, range, options) => { let min = null let minSV = null @@ -89654,11 +76867,11 @@ module.exports = minSatisfying /***/ }), /***/ 76368: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const Range = __webpack_require__(45636) -const gt = __webpack_require__(20209) +const SemVer = __nccwpck_require__(95271) +const Range = __nccwpck_require__(45636) +const gt = __nccwpck_require__(20209) const minVersion = (range, loose) => { range = new Range(range, loose) @@ -89677,6 +76890,7 @@ const minVersion = (range, loose) => { for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] + let setMin = null comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) @@ -89691,8 +76905,8 @@ const minVersion = (range, loose) => { /* fallthrough */ case '': case '>=': - if (!minver || gt(minver, compver)) { - minver = compver + if (!setMin || gt(compver, setMin)) { + setMin = compver } break case '<': @@ -89704,6 +76918,8 @@ const minVersion = (range, loose) => { throw new Error(`Unexpected operation: ${comparator.operator}`) } }) + if (setMin && (!minver || gt(minver, setMin))) + minver = setMin } if (minver && range.test(minver)) { @@ -89718,17 +76934,17 @@ module.exports = minVersion /***/ }), /***/ 40332: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const SemVer = __webpack_require__(95271) -const Comparator = __webpack_require__(34777) +const SemVer = __nccwpck_require__(95271) +const Comparator = __nccwpck_require__(34777) const {ANY} = Comparator -const Range = __webpack_require__(45636) -const satisfies = __webpack_require__(60822) -const gt = __webpack_require__(20209) -const lt = __webpack_require__(86197) -const lte = __webpack_require__(16768) -const gte = __webpack_require__(68758) +const Range = __nccwpck_require__(45636) +const satisfies = __nccwpck_require__(60822) +const gt = __nccwpck_require__(20209) +const lt = __nccwpck_require__(86197) +const lte = __nccwpck_require__(16768) +const gte = __nccwpck_require__(68758) const outside = (version, range, hilo, options) => { version = new SemVer(version, options) @@ -89754,7 +76970,7 @@ const outside = (version, range, hilo, options) => { throw new TypeError('Must provide a hilo val of "<" or ">"') } - // If it satisifes the range it is not outside + // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false } @@ -89805,13 +77021,13 @@ module.exports = outside /***/ }), /***/ 67251: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. -const satisfies = __webpack_require__(60822) -const compare = __webpack_require__(23681) +const satisfies = __nccwpck_require__(60822) +const compare = __nccwpck_require__(23681) module.exports = (versions, range, options) => { const set = [] let min = null @@ -89856,12 +77072,12 @@ module.exports = (versions, range, options) => { /***/ }), /***/ 41455: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) -const { ANY } = __webpack_require__(34777) -const satisfies = __webpack_require__(60822) -const compare = __webpack_require__(23681) +const Range = __nccwpck_require__(45636) +const { ANY } = __nccwpck_require__(34777) +const satisfies = __nccwpck_require__(60822) +const compare = __nccwpck_require__(23681) // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a subset of some `R1, R2, ...` @@ -89881,15 +77097,18 @@ const compare = __webpack_require__(23681) // - If EQ satisfies every C, return true // - Else return false // - If GT -// - If GT is lower than any > or >= comp in C, return false +// - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If LT -// - If LT.semver is greater than that of any > comp in C, return false +// - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If any C is a = range, and GT or LT are set, return false // - Else return true const subset = (sub, dom, options) => { + if (sub === dom) + return true + sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false @@ -89912,6 +77131,9 @@ const subset = (sub, dom, options) => { } const simpleSubset = (sub, dom, options) => { + if (sub === dom) + return true + if (sub.length === 1 && sub[0].semver === ANY) return dom.length === 1 && dom[0].semver === ANY @@ -89950,6 +77172,7 @@ const simpleSubset = (sub, dom, options) => { if (!satisfies(eq, String(c), options)) return false } + return true } @@ -89961,7 +77184,7 @@ const simpleSubset = (sub, dom, options) => { if (gt) { if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) - if (higher === c) + if (higher === c && higher !== gt) return false } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false @@ -89969,7 +77192,7 @@ const simpleSubset = (sub, dom, options) => { if (lt) { if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) - if (lower === c) + if (lower === c && lower !== lt) return false } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false @@ -90018,9 +77241,9 @@ module.exports = subset /***/ }), /***/ 2959: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) +const Range = __nccwpck_require__(45636) // Mostly just for testing and legacy API reasons const toComparators = (range, options) => @@ -90033,9 +77256,9 @@ module.exports = toComparators /***/ }), /***/ 87472: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const Range = __webpack_require__(45636) +const Range = __nccwpck_require__(45636) const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. @@ -90051,28 +77274,42 @@ module.exports = validRange /***/ }), /***/ 81224: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module) => { "use strict"; -const {inspect} = __webpack_require__(31669); class NonError extends Error { constructor(message) { - super(inspect(message)); - this.name = 'NonError'; - Error.captureStackTrace(this, NonError); + super(NonError._prepareSuperMessage(message)); + Object.defineProperty(this, 'name', { + value: 'NonError', + configurable: true, + writable: true + }); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, NonError); + } + } + + static _prepareSuperMessage(message) { + try { + return JSON.stringify(message); + } catch (_) { + return String(message); + } } } const commonProperties = [ - 'name', - 'message', - 'stack', - 'code' + {property: 'name', enumerable: false}, + {property: 'message', enumerable: false}, + {property: 'stack', enumerable: false}, + {property: 'code', enumerable: true} ]; -const destroyCircular = (from, seen, to_) => { +const destroyCircular = ({from, seen, to_, forceEnumerable}) => { const to = to_ || (Array.isArray(from) ? [] : {}); seen.push(from); @@ -90088,16 +77325,21 @@ const destroyCircular = (from, seen, to_) => { } if (!seen.includes(from[key])) { - to[key] = destroyCircular(from[key], seen.slice()); + to[key] = destroyCircular({from: from[key], seen: seen.slice(), forceEnumerable}); continue; } to[key] = '[Circular]'; } - for (const property of commonProperties) { + for (const {property, enumerable} of commonProperties) { if (typeof from[property] === 'string') { - to[property] = from[property]; + Object.defineProperty(to, property, { + value: from[property], + enumerable: forceEnumerable ? true : enumerable, + configurable: true, + writable: true + }); } } @@ -90106,7 +77348,7 @@ const destroyCircular = (from, seen, to_) => { const serializeError = value => { if (typeof value === 'object' && value !== null) { - return destroyCircular(value, []); + return destroyCircular({from: value, seen: [], forceEnumerable: true}); } // People sometimes throw things besides Error objects… @@ -90125,7 +77367,7 @@ const deserializeError = value => { if (typeof value === 'object' && value !== null && !Array.isArray(value)) { const newError = new Error(); - destroyCircular(value, [], newError); + destroyCircular({from: value, seen: [], to_: newError}); return newError; } @@ -90141,11 +77383,11 @@ module.exports = { /***/ }), /***/ 95598: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const shebangRegex = __webpack_require__(99829); +const shebangRegex = __nccwpck_require__(99829); module.exports = (string = '') => { const match = string.match(shebangRegex); @@ -90178,16 +77420,16 @@ module.exports = /^#!(.*)/; /***/ }), /***/ 22317: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. -var assert = __webpack_require__(42357) -var signals = __webpack_require__(12935) +var assert = __nccwpck_require__(42357) +var signals = __nccwpck_require__(12935) var isWin = /^win/i.test(process.platform) -var EE = __webpack_require__(28614) +var EE = __nccwpck_require__(28614) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter @@ -90408,7 +77650,7 @@ if (process.platform === 'linux') { /***/ }), /***/ 94922: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* Copyright spdx-correct.js contributors @@ -90425,8 +77667,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -var parse = __webpack_require__(37258) -var spdxLicenseIds = __webpack_require__(94063) +var parse = __nccwpck_require__(37258) +var spdxLicenseIds = __nccwpck_require__(94063) function valid (string) { try { @@ -90779,13 +78021,13 @@ function upgradeGPLs (value) { /***/ }), /***/ 37258: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var scan = __webpack_require__(42429) -var parse = __webpack_require__(90757) +var scan = __nccwpck_require__(42429) +var parse = __nccwpck_require__(90757) module.exports = function (source) { return parse(scan(source)) @@ -90941,15 +78183,15 @@ module.exports = function (tokens) { /***/ }), /***/ 42429: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; var licenses = [] - .concat(__webpack_require__(94063)) - .concat(__webpack_require__(19324)) -var exceptions = __webpack_require__(83904) + .concat(__nccwpck_require__(94063)) + .concat(__nccwpck_require__(19324)) +var exceptions = __nccwpck_require__(83904) module.exports = function (source) { var index = 0 @@ -91079,264 +78321,387 @@ module.exports = function (source) { /***/ }), -/***/ 74273: -/***/ ((__unused_webpack_module, exports) => { - -/* global window, exports, define */ - -!function() { - 'use strict' - - var re = { - not_string: /[^s]/, - not_bool: /[^t]/, - not_type: /[^T]/, - not_primitive: /[^v]/, - number: /[diefg]/, - numeric_arg: /[bcdiefguxX]/, - json: /[j]/, - not_json: /[^j]/, - text: /^[^\x25]+/, - modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, - key: /^([a-z_][a-z_\d]*)/i, - key_access: /^\.([a-z_][a-z_\d]*)/i, - index_access: /^\[(\d+)\]/, - sign: /^[+-]/ - } +/***/ 90937: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - function sprintf(key) { - // `arguments` is not an array, but should be fine for this call - return sprintf_format(sprintf_parse(key), arguments) - } +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - function vsprintf(fmt, argv) { - return sprintf.apply(null, [fmt].concat(argv || [])) - } - function sprintf_format(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign - for (i = 0; i < tree_length; i++) { - if (typeof parse_tree[i] === 'string') { - output += parse_tree[i] - } - else if (typeof parse_tree[i] === 'object') { - ph = parse_tree[i] // convenience purposes only - if (ph.keys) { // keyword argument - arg = argv[cursor] - for (k = 0; k < ph.keys.length; k++) { - if (arg == undefined) { - throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1])) - } - arg = arg[ph.keys[k]] - } - } - else if (ph.param_no) { // positional argument (explicit) - arg = argv[ph.param_no] - } - else { // positional argument (implicit) - arg = argv[cursor++] - } - if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) { - arg = arg() - } +/**/ - if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) { - throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)) - } +var Buffer = __nccwpck_require__(84996).Buffer; +/**/ - if (re.number.test(ph.type)) { - is_positive = arg >= 0 - } +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; - switch (ph.type) { - case 'b': - arg = parseInt(arg, 10).toString(2) - break - case 'c': - arg = String.fromCharCode(parseInt(arg, 10)) - break - case 'd': - case 'i': - arg = parseInt(arg, 10) - break - case 'j': - arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0) - break - case 'e': - arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential() - break - case 'f': - arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg) - break - case 'g': - arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg) - break - case 'o': - arg = (parseInt(arg, 10) >>> 0).toString(8) - break - case 's': - arg = String(arg) - arg = (ph.precision ? arg.substring(0, ph.precision) : arg) - break - case 't': - arg = String(!!arg) - arg = (ph.precision ? arg.substring(0, ph.precision) : arg) - break - case 'T': - arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase() - arg = (ph.precision ? arg.substring(0, ph.precision) : arg) - break - case 'u': - arg = parseInt(arg, 10) >>> 0 - break - case 'v': - arg = arg.valueOf() - arg = (ph.precision ? arg.substring(0, ph.precision) : arg) - break - case 'x': - arg = (parseInt(arg, 10) >>> 0).toString(16) - break - case 'X': - arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase() - break - } - if (re.json.test(ph.type)) { - output += arg - } - else { - if (re.number.test(ph.type) && (!is_positive || ph.sign)) { - sign = is_positive ? '+' : '-' - arg = arg.toString().replace(re.sign, '') - } - else { - sign = '' - } - pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ' - pad_length = ph.width - (sign + arg).length - pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : '' - output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg) - } - } - } - return output +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; } + } +}; - var sprintf_cache = Object.create(null) - - function sprintf_parse(fmt) { - if (sprintf_cache[fmt]) { - return sprintf_cache[fmt] - } - - var _fmt = fmt, match, parse_tree = [], arg_names = 0 - while (_fmt) { - if ((match = re.text.exec(_fmt)) !== null) { - parse_tree.push(match[0]) - } - else if ((match = re.modulo.exec(_fmt)) !== null) { - parse_tree.push('%') - } - else if ((match = re.placeholder.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1 - var field_list = [], replacement_field = match[2], field_match = [] - if ((field_match = re.key.exec(replacement_field)) !== null) { - field_list.push(field_match[1]) - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { - if ((field_match = re.key_access.exec(replacement_field)) !== null) { - field_list.push(field_match[1]) - } - else if ((field_match = re.index_access.exec(replacement_field)) !== null) { - field_list.push(field_match[1]) - } - else { - throw new SyntaxError('[sprintf] failed to parse named argument key') - } - } - } - else { - throw new SyntaxError('[sprintf] failed to parse named argument key') - } - match[2] = field_list - } - else { - arg_names |= 2 - } - if (arg_names === 3) { - throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported') - } +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} - parse_tree.push( - { - placeholder: match[0], - param_no: match[1], - keys: match[2], - sign: match[3], - pad_char: match[4], - align: match[5], - width: match[6], - precision: match[7], - type: match[8] - } - ) - } - else { - throw new SyntaxError('[sprintf] unexpected placeholder') - } - _fmt = _fmt.substring(match[0].length) - } - return sprintf_cache[fmt] = parse_tree +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.s = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } + return nb; + } + return 0; +} - /** - * export to either browser or node.js - */ - /* eslint-disable quote-props */ - if (true) { - exports.sprintf = sprintf - exports.vsprintf = vsprintf +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; } - if (typeof window !== 'undefined') { - window['sprintf'] = sprintf - window['vsprintf'] = vsprintf + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} - if (typeof define === 'function' && define['amd']) { - define(function() { - return { - 'sprintf': sprintf, - 'vsprintf': vsprintf - } - }) - } +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } } - /* eslint-enable quote-props */ -}(); // eslint-disable-line + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} /***/ }), -/***/ 61778: -/***/ ((module) => { +/***/ 84996: +/***/ ((module, exports, __nccwpck_require__) => { -"use strict"; +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = __nccwpck_require__(64293) +var Buffer = buffer.Buffer -module.exports = function (str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase(); - }); -}; +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} /***/ }), /***/ 26301: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const ansiRegex = __webpack_require__(89979); +const ansiRegex = __nccwpck_require__(89979); module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; @@ -91491,45 +78856,10 @@ module.exports = (jsonString, options = {}) => { }; -/***/ }), - -/***/ 77901: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var escapeStringRegexp = __webpack_require__(5813); - -module.exports = function (str, sub) { - if (typeof str !== 'string' || typeof sub !== 'string') { - throw new TypeError(); - } - - sub = escapeStringRegexp(sub); - return str.replace(new RegExp('^' + sub + '|' + sub + '$', 'g'), ''); -}; - - -/***/ }), - -/***/ 36889: -/***/ ((module) => { - -"use strict"; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(/^((?:\w+:)?\/\/)(?:[^@\/]+@)/, '$1'); -}; - - /***/ }), /***/ 85076: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /* Copyright 2016, 2017, 2019 Mark Lee and contributors @@ -91547,11 +78877,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -const debug = __webpack_require__(30787)('sumchecker') -const crypto = __webpack_require__(76417) -const fs = __webpack_require__(35747) -const path = __webpack_require__(85622) -const { promisify } = __webpack_require__(31669) +const debug = __nccwpck_require__(30787)('sumchecker') +const crypto = __nccwpck_require__(76417) +const fs = __nccwpck_require__(35747) +const path = __nccwpck_require__(85622) +const { promisify } = __nccwpck_require__(31669) const readFile = promisify(fs.readFile) @@ -91691,13 +79021,13 @@ module.exports = sumchecker /***/ }), /***/ 28106: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const os = __webpack_require__(12087); -const tty = __webpack_require__(33867); -const hasFlag = __webpack_require__(31306); +const os = __nccwpck_require__(12087); +const tty = __nccwpck_require__(33867); +const hasFlag = __nccwpck_require__(58379); const {env} = process; @@ -91777,7 +79107,7 @@ function supportsColor(haveStream, streamIsTTY) { } if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } @@ -91788,10 +79118,6 @@ function supportsColor(haveStream, streamIsTTY) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } - if ('GITHUB_ACTIONS' in env) { - return 1; - } - if (env.COLORTERM === 'truecolor') { return 3; } @@ -91835,30 +79161,14 @@ module.exports = { }; -/***/ }), - -/***/ 31306: -/***/ ((module) => { - -"use strict"; - - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; - - /***/ }), /***/ 40081: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {Readable} = __webpack_require__(92413); +const {Readable} = __nccwpck_require__(92413); module.exports = input => ( new Readable({ @@ -91870,433 +79180,29 @@ module.exports = input => ( ); -/***/ }), - -/***/ 1353: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/*! - * to-regex-range - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */ - - - -const isNumber = __webpack_require__(41255); - -const toRegexRange = (min, max, options) => { - if (isNumber(min) === false) { - throw new TypeError('toRegexRange: expected the first argument to be a number'); - } - - if (max === void 0 || min === max) { - return String(min); - } - - if (isNumber(max) === false) { - throw new TypeError('toRegexRange: expected the second argument to be a number.'); - } - - let opts = { relaxZeros: true, ...options }; - if (typeof opts.strictZeros === 'boolean') { - opts.relaxZeros = opts.strictZeros === false; - } - - let relax = String(opts.relaxZeros); - let shorthand = String(opts.shorthand); - let capture = String(opts.capture); - let wrap = String(opts.wrap); - let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; - - if (toRegexRange.cache.hasOwnProperty(cacheKey)) { - return toRegexRange.cache[cacheKey].result; - } - - let a = Math.min(min, max); - let b = Math.max(min, max); - - if (Math.abs(a - b) === 1) { - let result = min + '|' + max; - if (opts.capture) { - return `(${result})`; - } - if (opts.wrap === false) { - return result; - } - return `(?:${result})`; - } - - let isPadded = hasPadding(min) || hasPadding(max); - let state = { min, max, a, b }; - let positives = []; - let negatives = []; - - if (isPadded) { - state.isPadded = isPadded; - state.maxLen = String(state.max).length; - } - - if (a < 0) { - let newMin = b < 0 ? Math.abs(b) : 1; - negatives = splitToPatterns(newMin, Math.abs(a), state, opts); - a = state.a = 0; - } - - if (b >= 0) { - positives = splitToPatterns(a, b, state, opts); - } - - state.negatives = negatives; - state.positives = positives; - state.result = collatePatterns(negatives, positives, opts); - - if (opts.capture === true) { - state.result = `(${state.result})`; - } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { - state.result = `(?:${state.result})`; - } - - toRegexRange.cache[cacheKey] = state; - return state.result; -}; - -function collatePatterns(neg, pos, options) { - let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; - let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; - let intersected = filterPatterns(neg, pos, '-?', true, options) || []; - let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); - return subpatterns.join('|'); -} - -function splitToRanges(min, max) { - let nines = 1; - let zeros = 1; - - let stop = countNines(min, nines); - let stops = new Set([max]); - - while (min <= stop && stop <= max) { - stops.add(stop); - nines += 1; - stop = countNines(min, nines); - } - - stop = countZeros(max + 1, zeros) - 1; - - while (min < stop && stop <= max) { - stops.add(stop); - zeros += 1; - stop = countZeros(max + 1, zeros) - 1; - } - - stops = [...stops]; - stops.sort(compare); - return stops; -} - -/** - * Convert a range to a regex pattern - * @param {Number} `start` - * @param {Number} `stop` - * @return {String} - */ - -function rangeToPattern(start, stop, options) { - if (start === stop) { - return { pattern: start, count: [], digits: 0 }; - } - - let zipped = zip(start, stop); - let digits = zipped.length; - let pattern = ''; - let count = 0; - - for (let i = 0; i < digits; i++) { - let [startDigit, stopDigit] = zipped[i]; - - if (startDigit === stopDigit) { - pattern += startDigit; - - } else if (startDigit !== '0' || stopDigit !== '9') { - pattern += toCharacterClass(startDigit, stopDigit, options); - - } else { - count++; - } - } - - if (count) { - pattern += options.shorthand === true ? '\\d' : '[0-9]'; - } - - return { pattern, count: [count], digits }; -} - -function splitToPatterns(min, max, tok, options) { - let ranges = splitToRanges(min, max); - let tokens = []; - let start = min; - let prev; - - for (let i = 0; i < ranges.length; i++) { - let max = ranges[i]; - let obj = rangeToPattern(String(start), String(max), options); - let zeros = ''; - - if (!tok.isPadded && prev && prev.pattern === obj.pattern) { - if (prev.count.length > 1) { - prev.count.pop(); - } - - prev.count.push(obj.count[0]); - prev.string = prev.pattern + toQuantifier(prev.count); - start = max + 1; - continue; - } - - if (tok.isPadded) { - zeros = padZeros(max, tok, options); - } - - obj.string = zeros + obj.pattern + toQuantifier(obj.count); - tokens.push(obj); - start = max + 1; - prev = obj; - } - - return tokens; -} - -function filterPatterns(arr, comparison, prefix, intersection, options) { - let result = []; - - for (let ele of arr) { - let { string } = ele; - - // only push if _both_ are negative... - if (!intersection && !contains(comparison, 'string', string)) { - result.push(prefix + string); - } - - // or _both_ are positive - if (intersection && contains(comparison, 'string', string)) { - result.push(prefix + string); - } - } - return result; -} - -/** - * Zip strings - */ - -function zip(a, b) { - let arr = []; - for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); - return arr; -} - -function compare(a, b) { - return a > b ? 1 : b > a ? -1 : 0; -} - -function contains(arr, key, val) { - return arr.some(ele => ele[key] === val); -} - -function countNines(min, len) { - return Number(String(min).slice(0, -len) + '9'.repeat(len)); -} - -function countZeros(integer, zeros) { - return integer - (integer % Math.pow(10, zeros)); -} - -function toQuantifier(digits) { - let [start = 0, stop = ''] = digits; - if (stop || start > 1) { - return `{${start + (stop ? ',' + stop : '')}}`; - } - return ''; -} - -function toCharacterClass(a, b, options) { - return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; -} - -function hasPadding(str) { - return /^-?(0+)\d/.test(str); -} - -function padZeros(value, tok, options) { - if (!tok.isPadded) { - return value; - } - - let diff = Math.abs(tok.maxLen - String(value).length); - let relax = options.relaxZeros !== false; - - switch (diff) { - case 0: - return ''; - case 1: - return relax ? '0?' : '0'; - case 2: - return relax ? '0{0,2}' : '00'; - default: { - return relax ? `0{0,${diff}}` : `0{${diff}}`; - } - } -} - -/** - * Cache - */ - -toRegexRange.cache = {}; -toRegexRange.clearCache = () => (toRegexRange.cache = {}); - -/** - * Expose `toRegexRange` - */ - -module.exports = toRegexRange; - - -/***/ }), - -/***/ 41255: -/***/ ((module) => { - -"use strict"; -/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ - - - -module.exports = function(num) { - if (typeof num === 'number') { - return num - num === 0; - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); - } - return false; -}; - - -/***/ }), - -/***/ 33533: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var escapeStringRegexp = __webpack_require__(5813); - -module.exports = function (str, target) { - if (typeof str !== 'string' || typeof target !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(new RegExp('(?:' + escapeStringRegexp(target) + '){2,}', 'g'), target); -}; - - -/***/ }), - -/***/ 81786: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var truncate = __webpack_require__(7573); -var getLength = Buffer.byteLength.bind(Buffer); -module.exports = truncate.bind(null, getLength); - - -/***/ }), - -/***/ 7573: -/***/ ((module) => { - -"use strict"; - - -function isHighSurrogate(codePoint) { - return codePoint >= 0xd800 && codePoint <= 0xdbff; -} - -function isLowSurrogate(codePoint) { - return codePoint >= 0xdc00 && codePoint <= 0xdfff; -} - -// Truncate string by size in bytes -module.exports = function truncate(getLength, string, byteLength) { - if (typeof string !== "string") { - throw new Error("Input must be string"); - } - - var charLength = string.length; - var curByteLength = 0; - var codePoint; - var segment; - - for (var i = 0; i < charLength; i += 1) { - codePoint = string.charCodeAt(i); - segment = string[i]; - - if (isHighSurrogate(codePoint) && isLowSurrogate(string.charCodeAt(i + 1))) { - i += 1; - segment += string[i]; - } - - curByteLength += getLength(segment); - - if (curByteLength === byteLength) { - return string.slice(0, i + 1); - } - else if (curByteLength > byteLength) { - return string.slice(0, i - segment.length + 1); - } - } - - return string; -}; - - - /***/ }), /***/ 57951: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __webpack_require__(22030); +module.exports = __nccwpck_require__(22030); /***/ }), /***/ 22030: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var net = __webpack_require__(11631); -var tls = __webpack_require__(4016); -var http = __webpack_require__(98605); -var https = __webpack_require__(57211); -var events = __webpack_require__(28614); -var assert = __webpack_require__(42357); -var util = __webpack_require__(31669); +var net = __nccwpck_require__(11631); +var tls = __nccwpck_require__(4016); +var http = __nccwpck_require__(98605); +var https = __nccwpck_require__(57211); +var events = __nccwpck_require__(28614); +var assert = __nccwpck_require__(42357); +var util = __nccwpck_require__(31669); exports.httpOverHttp = httpOverHttp; @@ -92567,9 +79473,10 @@ exports.fromCallback = function (fn) { if (typeof args[args.length - 1] === 'function') fn.apply(this, args) else { return new Promise((resolve, reject) => { - fn.apply( + fn.call( this, - args.concat([(err, res) => err ? reject(err) : resolve(res)]) + ...args, + (err, res) => (err != null) ? reject(err) : resolve(res) ) }) } @@ -92588,12 +79495,12 @@ exports.fromPromise = function (fn) { /***/ }), /***/ 83530: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const url = __webpack_require__(78835); -const prependHttp = __webpack_require__(32979); +const url = __nccwpck_require__(78835); +const prependHttp = __nccwpck_require__(32979); module.exports = (input, options) => { if (typeof input !== 'string') { @@ -92605,13 +79512,26 @@ module.exports = (input, options) => { }; +/***/ }), + +/***/ 92262: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = __nccwpck_require__(31669).deprecate; + + /***/ }), /***/ 52078: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var parse = __webpack_require__(37258); -var correct = __webpack_require__(94922); +var parse = __nccwpck_require__(37258); +var correct = __nccwpck_require__(94922); var genericWarning = ( 'license should be ' + @@ -92758,13 +79678,13 @@ module.exports = [ /***/ }), /***/ 25997: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var defaults = __webpack_require__(36250) -var combining = __webpack_require__(34965) +var defaults = __nccwpck_require__(36250) +var combining = __nccwpck_require__(34965) var DEFAULTS = { nul: 0, @@ -92865,15 +79785,15 @@ function bisearch(ucs) { /***/ }), /***/ 67753: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' -const path = __webpack_require__(85622) +const path = __nccwpck_require__(85622) const COLON = isWindows ? ';' : ':' -const isexe = __webpack_require__(52607) +const isexe = __nccwpck_require__(52607) const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) @@ -93034,20 +79954,470 @@ function wrappy (fn, cb) { } +/***/ }), + +/***/ 5216: +/***/ ((module) => { + +"use strict"; + +module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value + } + } +} + + +/***/ }), + +/***/ 3652: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null + + return next +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.splice = function (start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1 + } + if (start < 0) { + start = this.length + start; + } + + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next + } + + var ret = [] + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value) + walker = this.removeNode(walker) + } + if (walker === null) { + walker = this.tail + } + + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev + } + + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]) + } + return ret; +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function insert (self, node, value) { + var inserted = node === self.head ? + new Node(value, null, node, self) : + new Node(value, node, node.next, self) + + if (inserted.next === null) { + self.tail = inserted + } + if (inserted.prev === null) { + self.head = inserted + } + + self.length++ + + return inserted +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} + +try { + // add if support for Symbol.iterator is present + __nccwpck_require__(5216)(Yallist) +} catch (er) {} + + /***/ }), /***/ 8245: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -var fs = __webpack_require__(35747); -var zlib = __webpack_require__(78761); -var fd_slicer = __webpack_require__(92104); -var crc32 = __webpack_require__(59832); -var util = __webpack_require__(31669); -var EventEmitter = __webpack_require__(28614).EventEmitter; -var Transform = __webpack_require__(92413).Transform; -var PassThrough = __webpack_require__(92413).PassThrough; -var Writable = __webpack_require__(92413).Writable; +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(35747); +var zlib = __nccwpck_require__(78761); +var fd_slicer = __nccwpck_require__(92104); +var crc32 = __nccwpck_require__(59832); +var util = __nccwpck_require__(31669); +var EventEmitter = __nccwpck_require__(28614).EventEmitter; +var Transform = __nccwpck_require__(92413).Transform; +var PassThrough = __nccwpck_require__(92413).PassThrough; +var Writable = __nccwpck_require__(92413).Writable; exports.open = open; exports.fromFd = fromFd; @@ -93840,7 +81210,7 @@ function defaultCallback(err) { /***/ }), /***/ 1590: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; /** @@ -93849,44 +81219,48 @@ function defaultCallback(err) { * @module aegir/utils */ -const { constants, createBrotliCompress, createGzip } = __webpack_require__(78761) -const os = __webpack_require__(12087) -const ora = __webpack_require__(5420) -const extract = __webpack_require__(2933) -const stripComments = __webpack_require__(96241) -const stripBom = __webpack_require__(16639) -const { download } = __webpack_require__(37196) -const path = __webpack_require__(85622) -const findUp = __webpack_require__(20219) -const readPkgUp = __webpack_require__(45730) -const fs = __webpack_require__(66272) -const execa = __webpack_require__(51737) -const pascalcase = __webpack_require__(27255) -const ghPages = __webpack_require__(56179) -const { promisify } = __webpack_require__(31669) - -const publishPages = promisify(ghPages.publish) - -const { packageJson: pkg, path: pkgPath } = readPkgUp.sync({ +const { constants, createBrotliCompress, createGzip } = __nccwpck_require__(78761) +const os = __nccwpck_require__(12087) +const ora = __nccwpck_require__(5420) +const extract = __nccwpck_require__(2933) +const stripComments = __nccwpck_require__(96241) +const stripBom = __nccwpck_require__(16639) +const { download } = __nccwpck_require__(37196) +const path = __nccwpck_require__(85622) +const readPkgUp = __nccwpck_require__(45730) +const fs = __nccwpck_require__(66272) +const execa = __nccwpck_require__(51737) +const envPaths = __nccwpck_require__(47727)('aegir', { suffix: '' }) +const lockfile = __nccwpck_require__(92123) +const { + packageJson: pkg, + path: pkgPath +} = readPkgUp.sync({ cwd: fs.realpathSync(process.cwd()) }) -const PKG_FILE = 'package.json' const DIST_FOLDER = 'dist' const SRC_FOLDER = 'src' +const TEST_FOLDER = 'test' -exports.paths = { - dist: DIST_FOLDER, - src: SRC_FOLDER -} exports.pkg = pkg -// TODO: get this from aegir package.json -exports.browserslist = '>1% or node >=10 and not ie 11 and not dead' exports.repoDirectory = path.dirname(pkgPath) exports.fromRoot = (...p) => path.join(exports.repoDirectory, ...p) exports.hasFile = (...p) => fs.existsSync(exports.fromRoot(...p)) exports.fromAegir = (...p) => path.join(__dirname, '..', ...p) exports.hasTsconfig = exports.hasFile('tsconfig.json') +exports.paths = { + dist: this.fromRoot(DIST_FOLDER), + src: this.fromRoot(SRC_FOLDER), + test: this.fromRoot(TEST_FOLDER), + package: pkgPath +} + +/** + * Parse json with comments or empty + * + * @param {string} contents + */ exports.parseJson = (contents) => { const data = stripComments(stripBom(contents)) @@ -93898,82 +81272,13 @@ exports.parseJson = (contents) => { return JSON.parse(data) } -exports.readJson = (filePath) => { - return exports.parseJson(fs.readFileSync(filePath, { encoding: 'utf-8' })) -} - -exports.publishDocs = () => { - return publishPages( - 'docs', - { - dotfiles: true, - message: 'chore: update documentation' - } - ) -} - /** - * Get package version + * Read JSON file * - * @returns {string} - version + * @param {string | number | Buffer | import("url").URL} filePath */ -exports.pkgVersion = async () => { - const { - version - } = await fs.readJson(exports.getPathToPkg()) - return version -} - -/** - * Gets the top level path of the project aegir is executed in. - * - * @returns {string} - base path - */ -exports.getBasePath = () => { - return process.cwd() -} - -exports.getPathToPkg = () => { - return path.join(exports.getBasePath(), PKG_FILE) -} - -exports.getPathToDist = () => { - return path.join(exports.getBasePath(), DIST_FOLDER) -} - -exports.getUserConfigPath = () => { - return findUp('.aegir.js') -} - -exports.getUserConfig = () => { - let conf = {} - try { - const path = exports.getUserConfigPath() - if (!path) { - return {} - } - conf = __webpack_require__(1039)(path) - } catch (err) { - console.error(err) // eslint-disable-line no-console - } - return conf -} - -/** - * Converts the given name from something like `peer-id` to `PeerId`. - * - * @param {string} name - lib name in kebab - * @returns {string} - lib name in pascal - */ -exports.getLibraryName = (name) => { - return pascalcase(name) -} - -/** - * Get the absolute path to `node_modules` for aegir itself - */ -exports.getPathToNodeModules = () => { - return path.resolve(__dirname, '../node_modules') +exports.readJson = (filePath) => { + return exports.parseJson(fs.readFileSync(filePath, { encoding: 'utf-8' })) } /** @@ -93987,6 +81292,7 @@ exports.getListrConfig = () => { } } +// @ts-ignore exports.hook = (env, key) => (ctx) => { if (ctx && ctx.hooks) { if (ctx.hooks[env] && ctx.hooks[env][key]) { @@ -94000,6 +81306,11 @@ exports.hook = (env, key) => (ctx) => { return Promise.resolve() } +/** + * @param {string} command + * @param {string[] | undefined} args + * @param {any} options + */ exports.exec = (command, args, options = {}) => { const result = execa(command, args, options) @@ -94031,7 +81342,24 @@ function getPlatformPath () { } exports.getElectron = async () => { - const pkg = __webpack_require__(28524) + const pkg = __nccwpck_require__(28524) + + const lockfilePath = path.join(envPaths.cache, '__electron-lock') + fs.mkdirpSync(envPaths.cache) + const releaseLock = await lockfile.lock(envPaths.cache, { + retries: { + retries: 10, + // Retry 20 times during 10 minutes with + // exponential back-off. + // See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions + factor: 1.27579 + }, + onCompromised: (err) => { + throw new Error(`${err.message} Path: ${lockfilePath}`) + }, + lockfilePath + }) + const version = pkg.devDependencies.electron.slice(1) const spinner = ora(`Downloading electron: ${version}`).start() const zipPath = await download(version) @@ -94040,10 +81368,14 @@ exports.getElectron = async () => { spinner.text = 'Extracting electron to system cache' await extract(zipPath, { dir: path.dirname(zipPath) }) } - spinner.succeed('Electron ready to use') + spinner.stop() + await releaseLock() return electronPath } +/** + * @param {fs.PathLike} path + */ exports.brotliSize = (path) => { return new Promise((resolve, reject) => { let size = 0 @@ -94062,6 +81394,9 @@ exports.brotliSize = (path) => { }) } +/** + * @param {fs.PathLike} path + */ exports.gzipSize = (path) => { return new Promise((resolve, reject) => { let size = 0 @@ -94143,7 +81478,15 @@ module.exports = JSON.parse("{\"dots\":{\"interval\":80,\"frames\":[\"⠋\",\" /***/ }), -/***/ 50354: +/***/ 66256: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse("{\"name\":\"got\",\"version\":\"9.6.0\",\"description\":\"Simplified HTTP requests\",\"license\":\"MIT\",\"repository\":\"sindresorhus/got\",\"main\":\"source\",\"engines\":{\"node\":\">=8.6\"},\"scripts\":{\"test\":\"xo && nyc ava\",\"release\":\"np\"},\"files\":[\"source\"],\"keywords\":[\"http\",\"https\",\"get\",\"got\",\"url\",\"uri\",\"request\",\"util\",\"utility\",\"simple\",\"curl\",\"wget\",\"fetch\",\"net\",\"network\",\"electron\"],\"dependencies\":{\"@sindresorhus/is\":\"^0.14.0\",\"@szmarczak/http-timer\":\"^1.1.2\",\"cacheable-request\":\"^6.0.0\",\"decompress-response\":\"^3.3.0\",\"duplexer3\":\"^0.1.4\",\"get-stream\":\"^4.1.0\",\"lowercase-keys\":\"^1.0.1\",\"mimic-response\":\"^1.0.1\",\"p-cancelable\":\"^1.0.0\",\"to-readable-stream\":\"^1.0.0\",\"url-parse-lax\":\"^3.0.0\"},\"devDependencies\":{\"ava\":\"^1.1.0\",\"coveralls\":\"^3.0.0\",\"delay\":\"^4.1.0\",\"form-data\":\"^2.3.3\",\"get-port\":\"^4.0.0\",\"np\":\"^3.1.0\",\"nyc\":\"^13.1.0\",\"p-event\":\"^2.1.0\",\"pem\":\"^1.13.2\",\"proxyquire\":\"^2.0.1\",\"sinon\":\"^7.2.2\",\"slow-stream\":\"0.0.4\",\"tempfile\":\"^2.0.0\",\"tempy\":\"^0.2.1\",\"tough-cookie\":\"^3.0.0\",\"xo\":\"^0.24.0\"},\"ava\":{\"concurrency\":4},\"browser\":{\"decompress-response\":false,\"electron\":false}}"); + +/***/ }), + +/***/ 52777: /***/ ((module) => { "use strict"; @@ -94151,7 +81494,7 @@ module.exports = JSON.parse("[[\"8740\",\"䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅 /***/ }), -/***/ 13768: +/***/ 1351: /***/ ((module) => { "use strict"; @@ -94159,7 +81502,7 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",127,\"€\"],[\"8140\",\"丂丄 /***/ }), -/***/ 67726: +/***/ 86401: /***/ ((module) => { "use strict"; @@ -94167,7 +81510,7 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"8141\",\"갂갃갅갆 /***/ }), -/***/ 47428: +/***/ 23940: /***/ ((module) => { "use strict"; @@ -94175,7 +81518,7 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"a140\",\" ,、。 /***/ }), -/***/ 34674: +/***/ 84777: /***/ ((module) => { "use strict"; @@ -94183,7 +81526,7 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"8ea1\",\"。\",62],[\"a /***/ }), -/***/ 80139: +/***/ 9630: /***/ ((module) => { "use strict"; @@ -94191,7 +81534,7 @@ module.exports = JSON.parse("{\"uChars\":[128,165,169,178,184,216,226,235,238,24 /***/ }), -/***/ 19416: +/***/ 17559: /***/ ((module) => { "use strict"; @@ -94199,7 +81542,7 @@ module.exports = JSON.parse("[[\"a140\",\"\",62],[\"a180\",\"\",32],[\"a24 /***/ }), -/***/ 24438: +/***/ 8075: /***/ ((module) => { "use strict"; @@ -94207,11 +81550,11 @@ module.exports = JSON.parse("[[\"0\",\"\\u0000\",128],[\"a1\",\"。\",62],[\"814 /***/ }), -/***/ 66256: +/***/ 74986: /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"name\":\"got\",\"version\":\"9.6.0\",\"description\":\"Simplified HTTP requests\",\"license\":\"MIT\",\"repository\":\"sindresorhus/got\",\"main\":\"source\",\"engines\":{\"node\":\">=8.6\"},\"scripts\":{\"test\":\"xo && nyc ava\",\"release\":\"np\"},\"files\":[\"source\"],\"keywords\":[\"http\",\"https\",\"get\",\"got\",\"url\",\"uri\",\"request\",\"util\",\"utility\",\"simple\",\"curl\",\"wget\",\"fetch\",\"net\",\"network\",\"electron\"],\"dependencies\":{\"@sindresorhus/is\":\"^0.14.0\",\"@szmarczak/http-timer\":\"^1.1.2\",\"cacheable-request\":\"^6.0.0\",\"decompress-response\":\"^3.3.0\",\"duplexer3\":\"^0.1.4\",\"get-stream\":\"^4.1.0\",\"lowercase-keys\":\"^1.0.1\",\"mimic-response\":\"^1.0.1\",\"p-cancelable\":\"^1.0.0\",\"to-readable-stream\":\"^1.0.0\",\"url-parse-lax\":\"^3.0.0\"},\"devDependencies\":{\"ava\":\"^1.1.0\",\"coveralls\":\"^3.0.0\",\"delay\":\"^4.1.0\",\"form-data\":\"^2.3.3\",\"get-port\":\"^4.0.0\",\"np\":\"^3.1.0\",\"nyc\":\"^13.1.0\",\"p-event\":\"^2.1.0\",\"pem\":\"^1.13.2\",\"proxyquire\":\"^2.0.1\",\"sinon\":\"^7.2.2\",\"slow-stream\":\"0.0.4\",\"tempfile\":\"^2.0.0\",\"tempy\":\"^0.2.1\",\"tough-cookie\":\"^3.0.0\",\"xo\":\"^0.24.0\"},\"ava\":{\"concurrency\":4},\"browser\":{\"decompress-response\":false,\"electron\":false}}"); +module.exports = JSON.parse("{\"assert\":true,\"assert/strict\":\">= 15\",\"async_hooks\":\">= 8\",\"buffer_ieee754\":\"< 0.9.7\",\"buffer\":true,\"child_process\":true,\"cluster\":true,\"console\":true,\"constants\":true,\"crypto\":true,\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"diagnostics_channel\":\">= 15.1\",\"dns\":true,\"dns/promises\":\">= 15\",\"domain\":\">= 0.7.12\",\"events\":true,\"freelist\":\"< 6\",\"fs\":true,\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"_http_agent\":\">= 0.11.1\",\"_http_client\":\">= 0.11.1\",\"_http_common\":\">= 0.11.1\",\"_http_incoming\":\">= 0.11.1\",\"_http_outgoing\":\">= 0.11.1\",\"_http_server\":\">= 0.11.1\",\"http\":true,\"http2\":\">= 8.8\",\"https\":true,\"inspector\":\">= 8.0.0\",\"_linklist\":\"< 8\",\"module\":true,\"net\":true,\"node-inspect/lib/_inspect\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6.0 && < 12\",\"os\":true,\"path\":true,\"path/posix\":\">= 15.3\",\"path/win32\":\">= 15.3\",\"perf_hooks\":\">= 8.5\",\"process\":\">= 1\",\"punycode\":true,\"querystring\":true,\"readline\":true,\"repl\":true,\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"_stream_transform\":\">= 0.9.4\",\"_stream_wrap\":\">= 1.4.1\",\"_stream_passthrough\":\">= 0.9.4\",\"_stream_readable\":\">= 0.9.4\",\"_stream_writable\":\">= 0.9.4\",\"stream\":true,\"stream/promises\":\">= 15\",\"string_decoder\":true,\"sys\":[\">= 0.6 && < 0.7\",\">= 0.8\"],\"timers\":true,\"timers/promises\":\">= 15\",\"_tls_common\":\">= 0.11.13\",\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"tls\":true,\"trace_events\":\">= 10\",\"tty\":true,\"url\":true,\"util\":true,\"util/types\":\">= 15.3\",\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/consarray\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/logreader\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8\":\">= 1\",\"vm\":true,\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"zlib\":true}"); /***/ }), @@ -94235,7 +81578,7 @@ module.exports = JSON.parse("{\"repositories\":\"'repositories' (plural) Not sup /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"assert\":true,\"async_hooks\":\">= 8\",\"buffer_ieee754\":\"< 0.9.7\",\"buffer\":true,\"child_process\":true,\"cluster\":true,\"console\":true,\"constants\":true,\"crypto\":true,\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"dns\":true,\"domain\":true,\"events\":true,\"freelist\":\"< 6\",\"fs\":true,\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"_http_agent\":\">= 0.11.1\",\"_http_client\":\">= 0.11.1\",\"_http_common\":\">= 0.11.1\",\"_http_incoming\":\">= 0.11.1\",\"_http_outgoing\":\">= 0.11.1\",\"_http_server\":\">= 0.11.1\",\"http\":true,\"http2\":\">= 8.8\",\"https\":true,\"inspector\":\">= 8.0.0\",\"_linklist\":\"< 8\",\"module\":true,\"net\":true,\"node-inspect/lib/_inspect\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6.0 && < 12\",\"os\":true,\"path\":true,\"perf_hooks\":\">= 8.5\",\"process\":\">= 1\",\"punycode\":true,\"querystring\":true,\"readline\":true,\"repl\":true,\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"_stream_transform\":\">= 0.9.4\",\"_stream_wrap\":\">= 1.4.1\",\"_stream_passthrough\":\">= 0.9.4\",\"_stream_readable\":\">= 0.9.4\",\"_stream_writable\":\">= 0.9.4\",\"stream\":true,\"string_decoder\":true,\"sys\":true,\"timers\":true,\"_tls_common\":\">= 0.11.13\",\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"tls\":true,\"trace_events\":\">= 10\",\"tty\":true,\"url\":true,\"util\":true,\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/consarray\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/logreader\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8\":\">= 1\",\"vm\":true,\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"zlib\":true}"); +module.exports = JSON.parse("{\"assert\":true,\"assert/strict\":\">= 15\",\"async_hooks\":\">= 8\",\"buffer_ieee754\":\"< 0.9.7\",\"buffer\":true,\"child_process\":true,\"cluster\":true,\"console\":true,\"constants\":true,\"crypto\":true,\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"diagnostics_channel\":\">= 15.1\",\"dns\":true,\"dns/promises\":\">= 15\",\"domain\":\">= 0.7.12\",\"events\":true,\"freelist\":\"< 6\",\"fs\":true,\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"_http_agent\":\">= 0.11.1\",\"_http_client\":\">= 0.11.1\",\"_http_common\":\">= 0.11.1\",\"_http_incoming\":\">= 0.11.1\",\"_http_outgoing\":\">= 0.11.1\",\"_http_server\":\">= 0.11.1\",\"http\":true,\"http2\":\">= 8.8\",\"https\":true,\"inspector\":\">= 8.0.0\",\"_linklist\":\"< 8\",\"module\":true,\"net\":true,\"node-inspect/lib/_inspect\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6.0 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6.0 && < 12\",\"os\":true,\"path\":true,\"perf_hooks\":\">= 8.5\",\"process\":\">= 1\",\"punycode\":true,\"querystring\":true,\"readline\":true,\"repl\":true,\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"_stream_transform\":\">= 0.9.4\",\"_stream_wrap\":\">= 1.4.1\",\"_stream_passthrough\":\">= 0.9.4\",\"_stream_readable\":\">= 0.9.4\",\"_stream_writable\":\">= 0.9.4\",\"stream\":true,\"stream/promises\":\">= 15\",\"string_decoder\":true,\"sys\":[\">= 0.6 && < 0.7\",\">= 0.8\"],\"timers\":true,\"timers/promises\":\">= 15\",\"_tls_common\":\">= 0.11.13\",\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"tls\":true,\"trace_events\":\">= 10\",\"tty\":true,\"url\":true,\"util\":true,\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/consarray\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/logreader\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4.0 && < 5\",\">= 5.2.0 && < 12\"],\"v8\":\">= 1\",\"vm\":true,\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"zlib\":true}"); /***/ }), @@ -94243,7 +81586,7 @@ module.exports = JSON.parse("{\"assert\":true,\"async_hooks\":\">= 8\",\"buffer_ /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"author\":{\"email\":\"gajus@gajus.com\",\"name\":\"Gajus Kuizinas\",\"url\":\"http://gajus.com\"},\"ava\":{\"babel\":{\"compileAsTests\":[\"test/helpers/**/*\"]},\"files\":[\"test/roarr/**/*\"],\"require\":[\"@babel/register\"]},\"dependencies\":{\"boolean\":\"^3.0.0\",\"detect-node\":\"^2.0.4\",\"globalthis\":\"^1.0.1\",\"json-stringify-safe\":\"^5.0.1\",\"semver-compare\":\"^1.0.0\",\"sprintf-js\":\"^1.1.2\"},\"description\":\"JSON logger for Node.js and browser.\",\"devDependencies\":{\"@ava/babel\":\"^1.0.0\",\"@babel/cli\":\"^7.8.4\",\"@babel/core\":\"^7.8.4\",\"@babel/node\":\"^7.8.4\",\"@babel/plugin-transform-flow-strip-types\":\"^7.8.3\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.8.3\",\"ava\":\"^3.1.0\",\"babel-plugin-istanbul\":\"^6.0.0\",\"babel-plugin-transform-export-default-name\":\"^2.0.4\",\"coveralls\":\"^3.0.9\",\"domain-parent\":\"^1.0.0\",\"eslint\":\"^6.8.0\",\"eslint-config-canonical\":\"^18.1.0\",\"flow-bin\":\"^0.117.0\",\"flow-copy-source\":\"^2.0.9\",\"gitdown\":\"^3.1.2\",\"husky\":\"^4.2.1\",\"nyc\":\"^15.0.0\",\"semantic-release\":\"^17.0.1\"},\"engines\":{\"node\":\">=8.0\"},\"husky\":{\"hooks\":{\"pre-commit\":\"npm run lint && npm run test && npm run build\",\"pre-push\":\"gitdown ./.README/README.md --output-file ./README.md --check\"}},\"keywords\":[\"log\",\"logger\",\"json\"],\"main\":\"./dist/log.js\",\"name\":\"roarr\",\"nyc\":{\"include\":[\"src/**/*.js\"],\"instrument\":false,\"reporter\":[\"text-lcov\"],\"require\":[\"@babel/register\"],\"sourceMap\":false},\"license\":\"BSD-3-Clause\",\"repository\":{\"type\":\"git\",\"url\":\"git@github.com:gajus/roarr.git\"},\"scripts\":{\"build\":\"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist\",\"create-readme\":\"gitdown ./.README/README.md --output-file ./README.md\",\"dev\":\"NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --watch\",\"lint\":\"eslint ./src ./test && flow\",\"test\":\"NODE_ENV=test ava --serial --verbose\"},\"version\":\"2.15.3\"}"); +module.exports = JSON.parse("{\"author\":{\"email\":\"gajus@gajus.com\",\"name\":\"Gajus Kuizinas\",\"url\":\"http://gajus.com\"},\"ava\":{\"babel\":{\"compileAsTests\":[\"test/helpers/**/*\"]},\"files\":[\"test/roarr/**/*\"],\"require\":[\"@babel/register\"]},\"dependencies\":{\"boolean\":\"^3.0.1\",\"detect-node\":\"^2.0.4\",\"globalthis\":\"^1.0.1\",\"json-stringify-safe\":\"^5.0.1\",\"semver-compare\":\"^1.0.0\",\"sprintf-js\":\"^1.1.2\"},\"description\":\"JSON logger for Node.js and browser.\",\"devDependencies\":{\"@ava/babel\":\"^1.0.1\",\"@babel/cli\":\"^7.11.6\",\"@babel/core\":\"^7.11.6\",\"@babel/node\":\"^7.10.5\",\"@babel/plugin-transform-flow-strip-types\":\"^7.10.4\",\"@babel/preset-env\":\"^7.11.5\",\"@babel/register\":\"^7.11.5\",\"ava\":\"^3.12.1\",\"babel-plugin-istanbul\":\"^6.0.0\",\"babel-plugin-transform-export-default-name\":\"^2.0.4\",\"coveralls\":\"^3.1.0\",\"domain-parent\":\"^1.0.0\",\"eslint\":\"^7.9.0\",\"eslint-config-canonical\":\"^24.1.1\",\"flow-bin\":\"^0.133.0\",\"flow-copy-source\":\"^2.0.9\",\"gitdown\":\"^3.1.3\",\"husky\":\"^4.3.0\",\"nyc\":\"^15.1.0\",\"semantic-release\":\"^17.1.1\"},\"engines\":{\"node\":\">=8.0\"},\"husky\":{\"hooks\":{\"pre-commit\":\"npm run lint && npm run test && npm run build\",\"pre-push\":\"gitdown ./.README/README.md --output-file ./README.md --check\"}},\"keywords\":[\"log\",\"logger\",\"json\"],\"main\":\"./dist/log.js\",\"name\":\"roarr\",\"nyc\":{\"include\":[\"src/**/*.js\"],\"instrument\":false,\"reporter\":[\"text-lcov\"],\"require\":[\"@babel/register\"],\"sourceMap\":false},\"license\":\"BSD-3-Clause\",\"repository\":{\"type\":\"git\",\"url\":\"git@github.com:gajus/roarr.git\"},\"scripts\":{\"build\":\"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist\",\"create-readme\":\"gitdown ./.README/README.md --output-file ./README.md\",\"dev\":\"NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --watch\",\"lint\":\"eslint ./src ./test && flow\",\"test\":\"NODE_ENV=test ava --serial --verbose\"},\"version\":\"2.15.4\"}"); /***/ }), @@ -94259,7 +81602,7 @@ module.exports = JSON.parse("[\"389-exception\",\"Autoconf-exception-2.0\",\"Aut /***/ ((module) => { "use strict"; -module.exports = JSON.parse("[\"AGPL-1.0\",\"AGPL-3.0\",\"GFDL-1.1\",\"GFDL-1.2\",\"GFDL-1.3\",\"GPL-1.0\",\"GPL-2.0\",\"GPL-2.0-with-GCC-exception\",\"GPL-2.0-with-autoconf-exception\",\"GPL-2.0-with-bison-exception\",\"GPL-2.0-with-classpath-exception\",\"GPL-2.0-with-font-exception\",\"GPL-3.0\",\"GPL-3.0-with-GCC-exception\",\"GPL-3.0-with-autoconf-exception\",\"LGPL-2.0\",\"LGPL-2.1\",\"LGPL-3.0\",\"Nunit\",\"StandardML-NJ\",\"eCos-2.0\",\"wxWindows\"]"); +module.exports = JSON.parse("[\"AGPL-1.0\",\"AGPL-3.0\",\"BSD-2-Clause-FreeBSD\",\"BSD-2-Clause-NetBSD\",\"GFDL-1.1\",\"GFDL-1.2\",\"GFDL-1.3\",\"GPL-1.0\",\"GPL-2.0\",\"GPL-2.0-with-GCC-exception\",\"GPL-2.0-with-autoconf-exception\",\"GPL-2.0-with-bison-exception\",\"GPL-2.0-with-classpath-exception\",\"GPL-2.0-with-font-exception\",\"GPL-3.0\",\"GPL-3.0-with-GCC-exception\",\"GPL-3.0-with-autoconf-exception\",\"LGPL-2.0\",\"LGPL-2.1\",\"LGPL-3.0\",\"Nunit\",\"StandardML-NJ\",\"eCos-2.0\",\"wxWindows\"]"); /***/ }), @@ -94267,7 +81610,7 @@ module.exports = JSON.parse("[\"AGPL-1.0\",\"AGPL-3.0\",\"GFDL-1.1\",\"GFDL-1.2\ /***/ ((module) => { "use strict"; -module.exports = JSON.parse("[\"0BSD\",\"AAL\",\"ADSL\",\"AFL-1.1\",\"AFL-1.2\",\"AFL-2.0\",\"AFL-2.1\",\"AFL-3.0\",\"AGPL-1.0-only\",\"AGPL-1.0-or-later\",\"AGPL-3.0-only\",\"AGPL-3.0-or-later\",\"AMDPLPA\",\"AML\",\"AMPAS\",\"ANTLR-PD\",\"APAFML\",\"APL-1.0\",\"APSL-1.0\",\"APSL-1.1\",\"APSL-1.2\",\"APSL-2.0\",\"Abstyles\",\"Adobe-2006\",\"Adobe-Glyph\",\"Afmparse\",\"Aladdin\",\"Apache-1.0\",\"Apache-1.1\",\"Apache-2.0\",\"Artistic-1.0\",\"Artistic-1.0-Perl\",\"Artistic-1.0-cl8\",\"Artistic-2.0\",\"BSD-1-Clause\",\"BSD-2-Clause\",\"BSD-2-Clause-FreeBSD\",\"BSD-2-Clause-NetBSD\",\"BSD-2-Clause-Patent\",\"BSD-3-Clause\",\"BSD-3-Clause-Attribution\",\"BSD-3-Clause-Clear\",\"BSD-3-Clause-LBNL\",\"BSD-3-Clause-No-Nuclear-License\",\"BSD-3-Clause-No-Nuclear-License-2014\",\"BSD-3-Clause-No-Nuclear-Warranty\",\"BSD-3-Clause-Open-MPI\",\"BSD-4-Clause\",\"BSD-4-Clause-UC\",\"BSD-Protection\",\"BSD-Source-Code\",\"BSL-1.0\",\"Bahyph\",\"Barr\",\"Beerware\",\"BitTorrent-1.0\",\"BitTorrent-1.1\",\"BlueOak-1.0.0\",\"Borceux\",\"CATOSL-1.1\",\"CC-BY-1.0\",\"CC-BY-2.0\",\"CC-BY-2.5\",\"CC-BY-3.0\",\"CC-BY-4.0\",\"CC-BY-NC-1.0\",\"CC-BY-NC-2.0\",\"CC-BY-NC-2.5\",\"CC-BY-NC-3.0\",\"CC-BY-NC-4.0\",\"CC-BY-NC-ND-1.0\",\"CC-BY-NC-ND-2.0\",\"CC-BY-NC-ND-2.5\",\"CC-BY-NC-ND-3.0\",\"CC-BY-NC-ND-4.0\",\"CC-BY-NC-SA-1.0\",\"CC-BY-NC-SA-2.0\",\"CC-BY-NC-SA-2.5\",\"CC-BY-NC-SA-3.0\",\"CC-BY-NC-SA-4.0\",\"CC-BY-ND-1.0\",\"CC-BY-ND-2.0\",\"CC-BY-ND-2.5\",\"CC-BY-ND-3.0\",\"CC-BY-ND-4.0\",\"CC-BY-SA-1.0\",\"CC-BY-SA-2.0\",\"CC-BY-SA-2.5\",\"CC-BY-SA-3.0\",\"CC-BY-SA-4.0\",\"CC-PDDC\",\"CC0-1.0\",\"CDDL-1.0\",\"CDDL-1.1\",\"CDLA-Permissive-1.0\",\"CDLA-Sharing-1.0\",\"CECILL-1.0\",\"CECILL-1.1\",\"CECILL-2.0\",\"CECILL-2.1\",\"CECILL-B\",\"CECILL-C\",\"CERN-OHL-1.1\",\"CERN-OHL-1.2\",\"CNRI-Jython\",\"CNRI-Python\",\"CNRI-Python-GPL-Compatible\",\"CPAL-1.0\",\"CPL-1.0\",\"CPOL-1.02\",\"CUA-OPL-1.0\",\"Caldera\",\"ClArtistic\",\"Condor-1.1\",\"Crossword\",\"CrystalStacker\",\"Cube\",\"D-FSL-1.0\",\"DOC\",\"DSDP\",\"Dotseqn\",\"ECL-1.0\",\"ECL-2.0\",\"EFL-1.0\",\"EFL-2.0\",\"EPL-1.0\",\"EPL-2.0\",\"EUDatagrid\",\"EUPL-1.0\",\"EUPL-1.1\",\"EUPL-1.2\",\"Entessa\",\"ErlPL-1.1\",\"Eurosym\",\"FSFAP\",\"FSFUL\",\"FSFULLR\",\"FTL\",\"Fair\",\"Frameworx-1.0\",\"FreeImage\",\"GFDL-1.1-only\",\"GFDL-1.1-or-later\",\"GFDL-1.2-only\",\"GFDL-1.2-or-later\",\"GFDL-1.3-only\",\"GFDL-1.3-or-later\",\"GL2PS\",\"GPL-1.0-only\",\"GPL-1.0-or-later\",\"GPL-2.0-only\",\"GPL-2.0-or-later\",\"GPL-3.0-only\",\"GPL-3.0-or-later\",\"Giftware\",\"Glide\",\"Glulxe\",\"HPND\",\"HPND-sell-variant\",\"HaskellReport\",\"IBM-pibs\",\"ICU\",\"IJG\",\"IPA\",\"IPL-1.0\",\"ISC\",\"ImageMagick\",\"Imlib2\",\"Info-ZIP\",\"Intel\",\"Intel-ACPI\",\"Interbase-1.0\",\"JPNIC\",\"JSON\",\"JasPer-2.0\",\"LAL-1.2\",\"LAL-1.3\",\"LGPL-2.0-only\",\"LGPL-2.0-or-later\",\"LGPL-2.1-only\",\"LGPL-2.1-or-later\",\"LGPL-3.0-only\",\"LGPL-3.0-or-later\",\"LGPLLR\",\"LPL-1.0\",\"LPL-1.02\",\"LPPL-1.0\",\"LPPL-1.1\",\"LPPL-1.2\",\"LPPL-1.3a\",\"LPPL-1.3c\",\"Latex2e\",\"Leptonica\",\"LiLiQ-P-1.1\",\"LiLiQ-R-1.1\",\"LiLiQ-Rplus-1.1\",\"Libpng\",\"Linux-OpenIB\",\"MIT\",\"MIT-0\",\"MIT-CMU\",\"MIT-advertising\",\"MIT-enna\",\"MIT-feh\",\"MITNFA\",\"MPL-1.0\",\"MPL-1.1\",\"MPL-2.0\",\"MPL-2.0-no-copyleft-exception\",\"MS-PL\",\"MS-RL\",\"MTLL\",\"MakeIndex\",\"MirOS\",\"Motosoto\",\"Multics\",\"Mup\",\"NASA-1.3\",\"NBPL-1.0\",\"NCSA\",\"NGPL\",\"NLOD-1.0\",\"NLPL\",\"NOSL\",\"NPL-1.0\",\"NPL-1.1\",\"NPOSL-3.0\",\"NRL\",\"NTP\",\"Naumen\",\"Net-SNMP\",\"NetCDF\",\"Newsletr\",\"Nokia\",\"Noweb\",\"OCCT-PL\",\"OCLC-2.0\",\"ODC-By-1.0\",\"ODbL-1.0\",\"OFL-1.0\",\"OFL-1.1\",\"OGL-UK-1.0\",\"OGL-UK-2.0\",\"OGL-UK-3.0\",\"OGTSL\",\"OLDAP-1.1\",\"OLDAP-1.2\",\"OLDAP-1.3\",\"OLDAP-1.4\",\"OLDAP-2.0\",\"OLDAP-2.0.1\",\"OLDAP-2.1\",\"OLDAP-2.2\",\"OLDAP-2.2.1\",\"OLDAP-2.2.2\",\"OLDAP-2.3\",\"OLDAP-2.4\",\"OLDAP-2.5\",\"OLDAP-2.6\",\"OLDAP-2.7\",\"OLDAP-2.8\",\"OML\",\"OPL-1.0\",\"OSET-PL-2.1\",\"OSL-1.0\",\"OSL-1.1\",\"OSL-2.0\",\"OSL-2.1\",\"OSL-3.0\",\"OpenSSL\",\"PDDL-1.0\",\"PHP-3.0\",\"PHP-3.01\",\"Parity-6.0.0\",\"Plexus\",\"PostgreSQL\",\"Python-2.0\",\"QPL-1.0\",\"Qhull\",\"RHeCos-1.1\",\"RPL-1.1\",\"RPL-1.5\",\"RPSL-1.0\",\"RSA-MD\",\"RSCPL\",\"Rdisc\",\"Ruby\",\"SAX-PD\",\"SCEA\",\"SGI-B-1.0\",\"SGI-B-1.1\",\"SGI-B-2.0\",\"SHL-0.5\",\"SHL-0.51\",\"SISSL\",\"SISSL-1.2\",\"SMLNJ\",\"SMPPL\",\"SNIA\",\"SPL-1.0\",\"SSPL-1.0\",\"SWL\",\"Saxpath\",\"Sendmail\",\"Sendmail-8.23\",\"SimPL-2.0\",\"Sleepycat\",\"Spencer-86\",\"Spencer-94\",\"Spencer-99\",\"SugarCRM-1.1.3\",\"TAPR-OHL-1.0\",\"TCL\",\"TCP-wrappers\",\"TMate\",\"TORQUE-1.1\",\"TOSL\",\"TU-Berlin-1.0\",\"TU-Berlin-2.0\",\"UPL-1.0\",\"Unicode-DFS-2015\",\"Unicode-DFS-2016\",\"Unicode-TOU\",\"Unlicense\",\"VOSTROM\",\"VSL-1.0\",\"Vim\",\"W3C\",\"W3C-19980720\",\"W3C-20150513\",\"WTFPL\",\"Watcom-1.0\",\"Wsuipa\",\"X11\",\"XFree86-1.1\",\"XSkat\",\"Xerox\",\"Xnet\",\"YPL-1.0\",\"YPL-1.1\",\"ZPL-1.1\",\"ZPL-2.0\",\"ZPL-2.1\",\"Zed\",\"Zend-2.0\",\"Zimbra-1.3\",\"Zimbra-1.4\",\"Zlib\",\"blessing\",\"bzip2-1.0.5\",\"bzip2-1.0.6\",\"copyleft-next-0.3.0\",\"copyleft-next-0.3.1\",\"curl\",\"diffmark\",\"dvipdfm\",\"eGenix\",\"gSOAP-1.3b\",\"gnuplot\",\"iMatix\",\"libpng-2.0\",\"libtiff\",\"mpich2\",\"psfrag\",\"psutils\",\"xinetd\",\"xpp\",\"zlib-acknowledgement\"]"); +module.exports = JSON.parse("[\"0BSD\",\"AAL\",\"ADSL\",\"AFL-1.1\",\"AFL-1.2\",\"AFL-2.0\",\"AFL-2.1\",\"AFL-3.0\",\"AGPL-1.0-only\",\"AGPL-1.0-or-later\",\"AGPL-3.0-only\",\"AGPL-3.0-or-later\",\"AMDPLPA\",\"AML\",\"AMPAS\",\"ANTLR-PD\",\"ANTLR-PD-fallback\",\"APAFML\",\"APL-1.0\",\"APSL-1.0\",\"APSL-1.1\",\"APSL-1.2\",\"APSL-2.0\",\"Abstyles\",\"Adobe-2006\",\"Adobe-Glyph\",\"Afmparse\",\"Aladdin\",\"Apache-1.0\",\"Apache-1.1\",\"Apache-2.0\",\"Artistic-1.0\",\"Artistic-1.0-Perl\",\"Artistic-1.0-cl8\",\"Artistic-2.0\",\"BSD-1-Clause\",\"BSD-2-Clause\",\"BSD-2-Clause-Patent\",\"BSD-2-Clause-Views\",\"BSD-3-Clause\",\"BSD-3-Clause-Attribution\",\"BSD-3-Clause-Clear\",\"BSD-3-Clause-LBNL\",\"BSD-3-Clause-No-Nuclear-License\",\"BSD-3-Clause-No-Nuclear-License-2014\",\"BSD-3-Clause-No-Nuclear-Warranty\",\"BSD-3-Clause-Open-MPI\",\"BSD-4-Clause\",\"BSD-4-Clause-UC\",\"BSD-Protection\",\"BSD-Source-Code\",\"BSL-1.0\",\"BUSL-1.1\",\"Bahyph\",\"Barr\",\"Beerware\",\"BitTorrent-1.0\",\"BitTorrent-1.1\",\"BlueOak-1.0.0\",\"Borceux\",\"CAL-1.0\",\"CAL-1.0-Combined-Work-Exception\",\"CATOSL-1.1\",\"CC-BY-1.0\",\"CC-BY-2.0\",\"CC-BY-2.5\",\"CC-BY-3.0\",\"CC-BY-3.0-AT\",\"CC-BY-3.0-US\",\"CC-BY-4.0\",\"CC-BY-NC-1.0\",\"CC-BY-NC-2.0\",\"CC-BY-NC-2.5\",\"CC-BY-NC-3.0\",\"CC-BY-NC-4.0\",\"CC-BY-NC-ND-1.0\",\"CC-BY-NC-ND-2.0\",\"CC-BY-NC-ND-2.5\",\"CC-BY-NC-ND-3.0\",\"CC-BY-NC-ND-3.0-IGO\",\"CC-BY-NC-ND-4.0\",\"CC-BY-NC-SA-1.0\",\"CC-BY-NC-SA-2.0\",\"CC-BY-NC-SA-2.5\",\"CC-BY-NC-SA-3.0\",\"CC-BY-NC-SA-4.0\",\"CC-BY-ND-1.0\",\"CC-BY-ND-2.0\",\"CC-BY-ND-2.5\",\"CC-BY-ND-3.0\",\"CC-BY-ND-4.0\",\"CC-BY-SA-1.0\",\"CC-BY-SA-2.0\",\"CC-BY-SA-2.0-UK\",\"CC-BY-SA-2.5\",\"CC-BY-SA-3.0\",\"CC-BY-SA-3.0-AT\",\"CC-BY-SA-4.0\",\"CC-PDDC\",\"CC0-1.0\",\"CDDL-1.0\",\"CDDL-1.1\",\"CDLA-Permissive-1.0\",\"CDLA-Sharing-1.0\",\"CECILL-1.0\",\"CECILL-1.1\",\"CECILL-2.0\",\"CECILL-2.1\",\"CECILL-B\",\"CECILL-C\",\"CERN-OHL-1.1\",\"CERN-OHL-1.2\",\"CERN-OHL-P-2.0\",\"CERN-OHL-S-2.0\",\"CERN-OHL-W-2.0\",\"CNRI-Jython\",\"CNRI-Python\",\"CNRI-Python-GPL-Compatible\",\"CPAL-1.0\",\"CPL-1.0\",\"CPOL-1.02\",\"CUA-OPL-1.0\",\"Caldera\",\"ClArtistic\",\"Condor-1.1\",\"Crossword\",\"CrystalStacker\",\"Cube\",\"D-FSL-1.0\",\"DOC\",\"DSDP\",\"Dotseqn\",\"ECL-1.0\",\"ECL-2.0\",\"EFL-1.0\",\"EFL-2.0\",\"EPICS\",\"EPL-1.0\",\"EPL-2.0\",\"EUDatagrid\",\"EUPL-1.0\",\"EUPL-1.1\",\"EUPL-1.2\",\"Entessa\",\"ErlPL-1.1\",\"Eurosym\",\"FSFAP\",\"FSFUL\",\"FSFULLR\",\"FTL\",\"Fair\",\"Frameworx-1.0\",\"FreeImage\",\"GFDL-1.1-invariants-only\",\"GFDL-1.1-invariants-or-later\",\"GFDL-1.1-no-invariants-only\",\"GFDL-1.1-no-invariants-or-later\",\"GFDL-1.1-only\",\"GFDL-1.1-or-later\",\"GFDL-1.2-invariants-only\",\"GFDL-1.2-invariants-or-later\",\"GFDL-1.2-no-invariants-only\",\"GFDL-1.2-no-invariants-or-later\",\"GFDL-1.2-only\",\"GFDL-1.2-or-later\",\"GFDL-1.3-invariants-only\",\"GFDL-1.3-invariants-or-later\",\"GFDL-1.3-no-invariants-only\",\"GFDL-1.3-no-invariants-or-later\",\"GFDL-1.3-only\",\"GFDL-1.3-or-later\",\"GL2PS\",\"GLWTPL\",\"GPL-1.0-only\",\"GPL-1.0-or-later\",\"GPL-2.0-only\",\"GPL-2.0-or-later\",\"GPL-3.0-only\",\"GPL-3.0-or-later\",\"Giftware\",\"Glide\",\"Glulxe\",\"HPND\",\"HPND-sell-variant\",\"HTMLTIDY\",\"HaskellReport\",\"Hippocratic-2.1\",\"IBM-pibs\",\"ICU\",\"IJG\",\"IPA\",\"IPL-1.0\",\"ISC\",\"ImageMagick\",\"Imlib2\",\"Info-ZIP\",\"Intel\",\"Intel-ACPI\",\"Interbase-1.0\",\"JPNIC\",\"JSON\",\"JasPer-2.0\",\"LAL-1.2\",\"LAL-1.3\",\"LGPL-2.0-only\",\"LGPL-2.0-or-later\",\"LGPL-2.1-only\",\"LGPL-2.1-or-later\",\"LGPL-3.0-only\",\"LGPL-3.0-or-later\",\"LGPLLR\",\"LPL-1.0\",\"LPL-1.02\",\"LPPL-1.0\",\"LPPL-1.1\",\"LPPL-1.2\",\"LPPL-1.3a\",\"LPPL-1.3c\",\"Latex2e\",\"Leptonica\",\"LiLiQ-P-1.1\",\"LiLiQ-R-1.1\",\"LiLiQ-Rplus-1.1\",\"Libpng\",\"Linux-OpenIB\",\"MIT\",\"MIT-0\",\"MIT-CMU\",\"MIT-advertising\",\"MIT-enna\",\"MIT-feh\",\"MIT-open-group\",\"MITNFA\",\"MPL-1.0\",\"MPL-1.1\",\"MPL-2.0\",\"MPL-2.0-no-copyleft-exception\",\"MS-PL\",\"MS-RL\",\"MTLL\",\"MakeIndex\",\"MirOS\",\"Motosoto\",\"MulanPSL-1.0\",\"MulanPSL-2.0\",\"Multics\",\"Mup\",\"NASA-1.3\",\"NBPL-1.0\",\"NCGL-UK-2.0\",\"NCSA\",\"NGPL\",\"NIST-PD\",\"NIST-PD-fallback\",\"NLOD-1.0\",\"NLPL\",\"NOSL\",\"NPL-1.0\",\"NPL-1.1\",\"NPOSL-3.0\",\"NRL\",\"NTP\",\"NTP-0\",\"Naumen\",\"Net-SNMP\",\"NetCDF\",\"Newsletr\",\"Nokia\",\"Noweb\",\"O-UDA-1.0\",\"OCCT-PL\",\"OCLC-2.0\",\"ODC-By-1.0\",\"ODbL-1.0\",\"OFL-1.0\",\"OFL-1.0-RFN\",\"OFL-1.0-no-RFN\",\"OFL-1.1\",\"OFL-1.1-RFN\",\"OFL-1.1-no-RFN\",\"OGC-1.0\",\"OGL-Canada-2.0\",\"OGL-UK-1.0\",\"OGL-UK-2.0\",\"OGL-UK-3.0\",\"OGTSL\",\"OLDAP-1.1\",\"OLDAP-1.2\",\"OLDAP-1.3\",\"OLDAP-1.4\",\"OLDAP-2.0\",\"OLDAP-2.0.1\",\"OLDAP-2.1\",\"OLDAP-2.2\",\"OLDAP-2.2.1\",\"OLDAP-2.2.2\",\"OLDAP-2.3\",\"OLDAP-2.4\",\"OLDAP-2.5\",\"OLDAP-2.6\",\"OLDAP-2.7\",\"OLDAP-2.8\",\"OML\",\"OPL-1.0\",\"OSET-PL-2.1\",\"OSL-1.0\",\"OSL-1.1\",\"OSL-2.0\",\"OSL-2.1\",\"OSL-3.0\",\"OpenSSL\",\"PDDL-1.0\",\"PHP-3.0\",\"PHP-3.01\",\"PSF-2.0\",\"Parity-6.0.0\",\"Parity-7.0.0\",\"Plexus\",\"PolyForm-Noncommercial-1.0.0\",\"PolyForm-Small-Business-1.0.0\",\"PostgreSQL\",\"Python-2.0\",\"QPL-1.0\",\"Qhull\",\"RHeCos-1.1\",\"RPL-1.1\",\"RPL-1.5\",\"RPSL-1.0\",\"RSA-MD\",\"RSCPL\",\"Rdisc\",\"Ruby\",\"SAX-PD\",\"SCEA\",\"SGI-B-1.0\",\"SGI-B-1.1\",\"SGI-B-2.0\",\"SHL-0.5\",\"SHL-0.51\",\"SISSL\",\"SISSL-1.2\",\"SMLNJ\",\"SMPPL\",\"SNIA\",\"SPL-1.0\",\"SSH-OpenSSH\",\"SSH-short\",\"SSPL-1.0\",\"SWL\",\"Saxpath\",\"Sendmail\",\"Sendmail-8.23\",\"SimPL-2.0\",\"Sleepycat\",\"Spencer-86\",\"Spencer-94\",\"Spencer-99\",\"SugarCRM-1.1.3\",\"TAPR-OHL-1.0\",\"TCL\",\"TCP-wrappers\",\"TMate\",\"TORQUE-1.1\",\"TOSL\",\"TU-Berlin-1.0\",\"TU-Berlin-2.0\",\"UCL-1.0\",\"UPL-1.0\",\"Unicode-DFS-2015\",\"Unicode-DFS-2016\",\"Unicode-TOU\",\"Unlicense\",\"VOSTROM\",\"VSL-1.0\",\"Vim\",\"W3C\",\"W3C-19980720\",\"W3C-20150513\",\"WTFPL\",\"Watcom-1.0\",\"Wsuipa\",\"X11\",\"XFree86-1.1\",\"XSkat\",\"Xerox\",\"Xnet\",\"YPL-1.0\",\"YPL-1.1\",\"ZPL-1.1\",\"ZPL-2.0\",\"ZPL-2.1\",\"Zed\",\"Zend-2.0\",\"Zimbra-1.3\",\"Zimbra-1.4\",\"Zlib\",\"blessing\",\"bzip2-1.0.5\",\"bzip2-1.0.6\",\"copyleft-next-0.3.0\",\"copyleft-next-0.3.1\",\"curl\",\"diffmark\",\"dvipdfm\",\"eGenix\",\"etalab-2.0\",\"gSOAP-1.3b\",\"gnuplot\",\"iMatix\",\"libpng-2.0\",\"libselinux-1.0\",\"libtiff\",\"mpich2\",\"psfrag\",\"psutils\",\"xinetd\",\"xpp\",\"zlib-acknowledgement\"]"); /***/ }), @@ -94275,22 +81618,7 @@ module.exports = JSON.parse("[\"0BSD\",\"AAL\",\"ADSL\",\"AFL-1.1\",\"AFL-1.2\", /***/ ((module) => { "use strict"; -module.exports = JSON.parse("{\"name\":\"aegir\",\"version\":\"28.2.0\",\"description\":\"JavaScript project management\",\"keywords\":[\"webpack\",\"standard\",\"lint\",\"build\"],\"homepage\":\"https://github.com/ipfs/aegir\",\"bugs\":\"https://github.com/ipfs/aegir/issues\",\"license\":\"MIT\",\"leadMaintainer\":\"Hugo Dias \",\"files\":[\"cmds\",\"utils\",\"src\",\"cli.js\",\"fixtures.js\"],\"main\":\"cli.js\",\"browser\":{\"fs\":false,\"./src/fixtures.js\":\"./src/fixtures.browser.js\"},\"bin\":{\"aegir\":\"cli.js\"},\"repository\":\"github:ipfs/aegir\",\"scripts\":{\"lint\":\"node cli.js lint\",\"test:node\":\"node cli.js test -t node\",\"test:browser\":\"node cli.js test -t browser webworker\",\"test:acceptance\":\"./test/acceptance.sh\",\"test\":\"npm run test:node && npm run test:browser\",\"coverage\":\"node cli.js coverage -t node\",\"watch\":\"node cli.js test -t node --watch\",\"release\":\"node cli.js release --no-test --no-build\",\"release-minor\":\"node cli.js release --no-build --no-test --type minor\",\"release-major\":\"node cli.js release --no-build --no-test --type major\"},\"dependencies\":{\"@achingbrain/dependency-check\":\"^4.1.0\",\"@babel/cli\":\"^7.12.1\",\"@babel/core\":\"^7.12.3\",\"@babel/plugin-transform-regenerator\":\"^7.12.1\",\"@babel/plugin-transform-runtime\":\"^7.12.1\",\"@babel/preset-env\":\"^7.12.1\",\"@babel/preset-typescript\":\"^7.12.1\",\"@babel/register\":\"^7.12.1\",\"@babel/runtime\":\"^7.12.5\",\"@commitlint/cli\":\"^11.0.0\",\"@commitlint/config-conventional\":\"^11.0.0\",\"@commitlint/lint\":\"^11.0.0\",\"@commitlint/load\":\"^11.0.0\",\"@commitlint/read\":\"^11.0.0\",\"@commitlint/travis-cli\":\"^11.0.0\",\"@electron/get\":\"^1.10.0\",\"@polka/send-type\":\"^0.5.2\",\"@types/mocha\":\"^8.0.4\",\"@types/node\":\"^14.14.8\",\"aegir-typedoc-theme\":\"^0.1.0\",\"babel-loader\":\"^8.2.1\",\"buffer\":\"^6.0.2\",\"bytes\":\"^3.1.0\",\"camelcase\":\"^6.2.0\",\"chai\":\"^4.2.0\",\"chai-as-promised\":\"^7.1.1\",\"chai-subset\":\"^1.6.0\",\"chalk\":\"^4.1.0\",\"conventional-changelog\":\"^3.1.24\",\"conventional-github-releaser\":\"^3.1.5\",\"cors\":\"^2.8.5\",\"cosmiconfig\":\"^7.0.0\",\"dirty-chai\":\"^2.0.1\",\"electron-mocha\":\"^9.3.2\",\"eslint\":\"^7.11.0\",\"eslint-config-ipfs\":\"^0.1.0\",\"execa\":\"^4.1.0\",\"extract-zip\":\"^2.0.1\",\"findup-sync\":\"^4.0.0\",\"fs-extra\":\"^9.0.1\",\"gh-pages\":\"^3.1.0\",\"git-authors-cli\":\"^1.0.31\",\"git-validate\":\"^2.2.4\",\"globby\":\"^11.0.1\",\"ipfs-utils\":\"^5.0.0\",\"it-glob\":\"~0.0.10\",\"json-loader\":\"~0.5.7\",\"karma\":\"^5.2.3\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-cli\":\"^2.0.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-mocha\":\"^2.0.1\",\"karma-mocha-reporter\":\"^2.2.5\",\"karma-mocha-webworker\":\"^1.3.0\",\"karma-sourcemap-loader\":\"~0.3.8\",\"karma-webpack\":\"4.0.2\",\"listr\":\"~0.14.2\",\"merge-options\":\"^3.0.3\",\"mocha\":\"^8.2.1\",\"npm-package-json-lint\":\"^5.1.0\",\"nyc\":\"^15.1.0\",\"ora\":\"^5.1.0\",\"p-map\":\"^4.0.0\",\"pascalcase\":\"^1.0.0\",\"polka\":\"^0.5.2\",\"premove\":\"^3.0.1\",\"prompt-promise\":\"^1.0.3\",\"read-pkg-up\":\"^7.0.1\",\"semver\":\"^7.3.2\",\"simple-git\":\"^2.22.0\",\"strip-bom\":\"^4.0.0\",\"strip-json-comments\":\"^3.1.1\",\"terser-webpack-plugin\":\"^3.0.5\",\"typedoc\":\"^0.19.2\",\"typescript\":\"^4.0.5\",\"update-notifier\":\"^5.0.0\",\"webpack\":\"^4.43.0\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.3.10\",\"webpack-merge\":\"^4.2.2\",\"yargs\":\"^16.1.1\",\"yargs-parser\":\"^20.2.3\"},\"devDependencies\":{\"electron\":\"^11.0.1\",\"iso-url\":\"^1.0.0\",\"mock-require\":\"^3.0.2\",\"sinon\":\"^9.2.1\"},\"engines\":{\"node\":\">=10.0.0\",\"npm\":\">=6.0.0\"},\"browserslist\":[\">1%\",\"last 2 versions\",\"Firefox ESR\",\"not ie < 11\"],\"eslintConfig\":{\"extends\":\"ipfs\"},\"contributors\":[\"dignifiedquire \",\"Hugo Dias \",\"victorbjelkholm \",\"David Dias \",\"Alex Potsides \",\"Volker Mische \",\"Alan Shaw \",\"Dmitriy Ryajov \",\"Jacob Heun \",\"Francis Yuen \",\"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ \",\"Henrique Dias \",\"Irakli Gozalishvili \",\"Maciej Krüger \",\"Adam Uhlíř \",\"Alberto Elias \",\"Diogo Silva \",\"Garren Smith \",\"Hector Sanjuan \",\"JGAntunes \",\"Jakub Sztandera \",\"Marcin Rataj \",\"Michael Garvin \",\"Mikeal Rogers \",\"Stephen Whitmore \",\"Vasco Santos \",\"0xflotus <0xflotus@gmail.com>\"]}"); - -/***/ }), - -/***/ 1039: -/***/ ((module) => { - -function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; -} -webpackEmptyContext.keys = () => []; -webpackEmptyContext.resolve = webpackEmptyContext; -webpackEmptyContext.id = 1039; -module.exports = webpackEmptyContext; +module.exports = JSON.parse("{\"name\":\"aegir\",\"version\":\"30.3.0\",\"description\":\"JavaScript project management\",\"keywords\":[\"webpack\",\"standard\",\"lint\",\"build\"],\"homepage\":\"https://github.com/ipfs/aegir\",\"bugs\":\"https://github.com/ipfs/aegir/issues\",\"license\":\"MIT\",\"leadMaintainer\":\"Hugo Dias \",\"files\":[\"dist/utils\",\"cmds\",\"utils\",\"src\",\"cli.js\",\"fixtures.js\"],\"main\":\"cli.js\",\"browser\":{\"fs\":false,\"./src/fixtures.js\":\"./src/fixtures.browser.js\"},\"bin\":{\"aegir\":\"cli.js\"},\"typesVersions\":{\"*\":{\"utils/*\":[\"dist/utils/*\"]}},\"repository\":\"github:ipfs/aegir\",\"scripts\":{\"prepare\":\"tsc -p tsconfig-types.json\",\"lint\":\"node cli.js lint\",\"test:node\":\"node cli.js test -t node\",\"test:browser\":\"node cli.js test -t browser webworker\",\"test:acceptance\":\"./test/acceptance.sh\",\"test\":\"npm run test:node && npm run test:browser\",\"coverage\":\"node cli.js coverage -t node\",\"watch\":\"node cli.js test -t node --watch\",\"release\":\"node cli.js release --no-docs --no-test --no-build\",\"release-minor\":\"node cli.js release --no-docs --no-build --no-test --type minor\",\"release-major\":\"node cli.js release --no-docs --no-build --no-test --type major\"},\"dependencies\":{\"@achingbrain/dependency-check\":\"^4.1.0\",\"@commitlint/cli\":\"^11.0.0\",\"@commitlint/config-conventional\":\"^11.0.0\",\"@commitlint/lint\":\"^11.0.0\",\"@commitlint/load\":\"^11.0.0\",\"@commitlint/read\":\"^11.0.0\",\"@commitlint/travis-cli\":\"^11.0.0\",\"@electron/get\":\"^1.12.3\",\"@polka/send-type\":\"^0.5.2\",\"@types/chai\":\"^4.2.15\",\"@types/chai-as-promised\":\"^7.1.3\",\"@types/chai-subset\":\"^1.3.3\",\"@types/dirty-chai\":\"^2.0.2\",\"@types/mocha\":\"^8.2.0\",\"@types/node\":\"^14.14.27\",\"@types/sinon\":\"^9.0.10\",\"buffer\":\"^6.0.3\",\"bytes\":\"^3.1.0\",\"c8\":\"^7.5.0\",\"camelcase\":\"^6.2.0\",\"chai\":\"^4.2.0\",\"chai-as-promised\":\"^7.1.1\",\"chai-subset\":\"^1.6.0\",\"conventional-changelog\":\"^3.1.24\",\"conventional-github-releaser\":\"^3.1.5\",\"copyfiles\":\"^2.4.1\",\"cors\":\"^2.8.5\",\"dirty-chai\":\"^2.0.1\",\"electron-mocha\":\"^10.0.0\",\"env-paths\":\"^2.2.0\",\"esbuild\":\"^0.8.44\",\"esbuild-register\":\"^2.0.0\",\"eslint\":\"^7.18.0\",\"eslint-config-ipfs\":\"^2.0.0\",\"execa\":\"^5.0.0\",\"extract-zip\":\"^2.0.1\",\"fs-extra\":\"^9.1.0\",\"gh-pages\":\"^3.1.0\",\"git-authors-cli\":\"^1.0.33\",\"git-validate\":\"^2.2.4\",\"globby\":\"^11.0.2\",\"ipfs-utils\":\"^6.0.0\",\"it-glob\":\"~0.0.10\",\"kleur\":\"^4.1.4\",\"lilconfig\":\"^2.0.2\",\"listr\":\"~0.14.2\",\"merge-options\":\"^3.0.4\",\"mocha\":\"^8.3.0\",\"npm-package-json-lint\":\"^5.1.0\",\"nyc\":\"^15.1.0\",\"ora\":\"^5.3.0\",\"p-map\":\"^4.0.0\",\"pascalcase\":\"^1.0.0\",\"playwright-test\":\"hugomrdias/playwright-test#feat/esbuild\",\"polka\":\"^0.5.2\",\"premove\":\"^3.0.1\",\"prompt-promise\":\"^1.0.3\",\"proper-lockfile\":\"^4.1.2\",\"read-pkg-up\":\"^7.0.1\",\"semver\":\"^7.3.4\",\"simple-git\":\"^2.28.0\",\"strip-bom\":\"^4.0.0\",\"strip-json-comments\":\"^3.1.1\",\"tempy\":\"^1.0.0\",\"typedoc\":\"^0.20.24\",\"typescript\":\"4.1.5\",\"update-notifier\":\"^5.0.0\",\"yargs\":\"^16.2.0\",\"yargs-parser\":\"^20.2.3\"},\"devDependencies\":{\"@types/bytes\":\"^3.1.0\",\"@types/eslint\":\"^7.2.6\",\"@types/fs-extra\":\"^9.0.7\",\"@types/gh-pages\":\"^3.0.0\",\"@types/listr\":\"^0.14.2\",\"@types/polka\":\"^0.5.2\",\"@types/proper-lockfile\":\"^4.1.1\",\"@types/semver\":\"^7.3.4\",\"@types/yargs\":\"^16.0.0\",\"electron\":\"^11.2.0\",\"iso-url\":\"^1.0.0\",\"sinon\":\"^9.2.3\"},\"engines\":{\"node\":\">=12.0.0\",\"npm\":\">=6.0.0\"},\"browserslist\":[\">1%\",\"last 2 versions\",\"Firefox ESR\",\"not ie < 11\"],\"eslintConfig\":{\"extends\":\"ipfs\"},\"contributors\":[\"dignifiedquire \",\"Hugo Dias \",\"victorbjelkholm \",\"David Dias \",\"Alex Potsides \",\"Volker Mische \",\"Alan Shaw \",\"Jacob Heun \",\"Dmitriy Ryajov \",\"Irakli Gozalishvili \",\"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ \",\"Henrique Dias \",\"Francis Yuen \",\"Maciej Krüger \",\"Adam Uhlíř \",\"Alberto Elias \",\"Diogo Silva \",\"Garren Smith \",\"Hector Sanjuan \",\"JGAntunes \",\"Jakub Sztandera \",\"Marcin Rataj \",\"Michael Garvin \",\"Mikeal Rogers \",\"Stephen Whitmore \",\"Vasco Santos \",\"0xflotus <0xflotus@gmail.com>\"]}"); /***/ }), @@ -94406,14 +81734,6 @@ module.exports = require("perf_hooks");; /***/ }), -/***/ 94213: -/***/ ((module) => { - -"use strict"; -module.exports = require("punycode");; - -/***/ }), - /***/ 51058: /***/ ((module) => { @@ -94484,7 +81804,7 @@ module.exports = require("zlib");; /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function -/******/ function __webpack_require__(moduleId) { +/******/ function __nccwpck_require__(moduleId) { /******/ // Check if module is in cache /******/ if(__webpack_module_cache__[moduleId]) { /******/ return __webpack_module_cache__[moduleId].exports; @@ -94499,7 +81819,7 @@ module.exports = require("zlib");; /******/ // Execute the module function /******/ var threw = true; /******/ try { -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); /******/ threw = false; /******/ } finally { /******/ if(threw) delete __webpack_module_cache__[moduleId]; @@ -94513,14 +81833,9 @@ module.exports = require("zlib");; /******/ } /******/ /************************************************************************/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) -/******/ })(); -/******/ /******/ /* webpack/runtime/node module decorator */ /******/ (() => { -/******/ __webpack_require__.nmd = (module) => { +/******/ __nccwpck_require__.nmd = (module) => { /******/ module.paths = []; /******/ if (!module.children) module.children = []; /******/ return module; @@ -94529,10 +81844,10 @@ module.exports = require("zlib");; /******/ /******/ /* webpack/runtime/compat */ /******/ -/******/ __webpack_require__.ab = __dirname + "/";/************************************************************************/ +/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/ /******/ // module exports must be returned from runtime so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports -/******/ return __webpack_require__(32932); +/******/ return __nccwpck_require__(32932); /******/ })() ; \ No newline at end of file diff --git a/actions/bundle-size/package.json b/actions/bundle-size/package.json index 246e5b293..072992936 100644 --- a/actions/bundle-size/package.json +++ b/actions/bundle-size/package.json @@ -8,15 +8,15 @@ "build": "ncc build index.js" }, "dependencies": { - "@actions/artifact": "^0.4.1", + "@actions/artifact": "^0.5.0", "@actions/core": "^1.2.6", "@actions/exec": "^1.0.3", "@actions/github": "^4.0.0", - "execa": "^4.1.0", - "globby": "^11.0.0", + "execa": "^5.0.0", + "globby": "^11.0.2", "read-pkg-up": "^7.0.1" }, "devDependencies": { - "@vercel/ncc": "^0.25.1" + "@vercel/ncc": "^0.27.0" } } diff --git a/actions/bundle-size/utils.js b/actions/bundle-size/utils.js index eedc7f7b2..680939596 100644 --- a/actions/bundle-size/utils.js +++ b/actions/bundle-size/utils.js @@ -10,7 +10,10 @@ const { pkg } = require('../../src/utils') const aegirExec = pkg.name === 'aegir' ? './cli.js' : 'aegir' -/** @typedef {import("@actions/github").context } Context */ +/** + * @typedef {import("@actions/github").context } Context + * @typedef {ReturnType} Github + */ /** * Bundle Size Check @@ -32,7 +35,7 @@ const sizeCheck = async (octokit, context, baseDir) => { try { check = await checkCreate(octokit, context, checkName) - const out = await execa(aegirExec, ['build', '-b'], { + const out = await execa(aegirExec, ['build', '-b', '--no-types'], { cwd: baseDir, localDir: '.', preferLocal: true, diff --git a/cli.js b/cli.js index 79e107abc..fb7b14246 100755 --- a/cli.js +++ b/cli.js @@ -8,12 +8,11 @@ process.on('unhandledRejection', (err) => { }) const updateNotifier = require('update-notifier') -const chalk = require('chalk') +const kleur = require('kleur') const pkg = require('./package.json') updateNotifier({ - pkg: pkg, - isGlobal: false + pkg: pkg }).notify() const cli = require('yargs') @@ -24,13 +23,13 @@ cli .usage('Usage: $0 [options]') .example('$0 build', 'Runs the build command to bundle JS code for the browser.') .example('npx $0 build', 'Can be used with `npx` to use a local version') - .example('$0 test -t webworker -- --browsers Firefox', 'If the command supports `--` can be used to forward options to the underlying tool.') - .example('npm test -- -- --browsers Firefox', 'If `npm test` translates to `aegir test -t browser` and you want to forward options you need to use `-- --` instead.') + .example('$0 test -t webworker -- --browser firefox', 'If the command supports `--` can be used to forward options to the underlying tool.') + .example('npm test -- -- --browser firefox', 'If `npm test` translates to `aegir test -t browser` and you want to forward options you need to use `-- --` instead.') .epilog('Use `$0 --help` to learn more about each command.') .middleware((yargs) => { - yargs.config = userConfig + yargs.fileConfig = userConfig }) - .commandDir('cmds') + .commandDir('src/cmds') .help() .alias('help', 'h') .alias('version', 'v') @@ -40,18 +39,12 @@ cli alias: 'd', default: userConfig.debug }) - // TODO remove after webpack 5 upgrade - .options('node', { - type: 'boolean', - describe: 'Flag to control if bundler should inject node globals or built-ins.', - default: userConfig.node - }) .options('ts-repo', { type: 'boolean', describe: 'Enable support for Typescript repos.', default: userConfig.tsRepo }) - .group(['help', 'version', 'debug', 'node', 'ts-repo'], 'Global Options:') + .group(['help', 'version', 'debug', 'ts-repo'], 'Global Options:') .demandCommand(1, 'You need at least one command.') .wrap(cli.terminalWidth()) .parserConfiguration({ 'populate--': true }) @@ -62,7 +55,7 @@ cli const args = cli.fail((msg, err, yargs) => { if (msg) { yargs.showHelp() - console.error(chalk.red(msg)) + console.error(kleur.red(msg)) } if (err) { diff --git a/cmds/lint.js b/cmds/lint.js deleted file mode 100644 index 7a1331264..000000000 --- a/cmds/lint.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict' -const { userConfig } = require('../src/config/user') -module.exports = { - command: 'lint', - desc: 'Lint all project files', - builder: { - fix: { - alias: 'f', - type: 'boolean', - describe: 'Automatically fix errors if possible.', - default: userConfig.lint.fix - }, - files: { - type: 'array', - describe: 'Files to lint.', - default: userConfig.lint.files - }, - silent: { - type: 'boolean', - describe: 'Disable eslint output.', - default: userConfig.lint.silent - } - }, - handler (argv) { - const lint = require('../src/lint') - return lint(argv) - } -} diff --git a/cmds/publish-rc.js b/cmds/publish-rc.js deleted file mode 100644 index eb931e9ef..000000000 --- a/cmds/publish-rc.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict' - -module.exports = { - command: 'publish-rc', - desc: 'Publish a release candidate', - builder: { - branch: { - describe: 'Where the latest good build is', - type: 'string', - default: 'build/last-successful' - }, - remote: { - describe: 'Which remote to use', - type: 'string', - default: 'origin' - }, - distTag: { - describe: 'The dist tag to publish the rc as', - type: 'string', - default: 'next' - }, - preId: { - describe: 'What to call the rc', - type: 'string', - default: 'rc' - }, - type: { - describe: 'What sort of update this will be', - type: 'string', - default: 'minor' - }, - prefix: { - describe: 'What to prefix the branch name with', - type: 'string', - default: 'release/' - } - }, - handler (argv) { - const cmd = require('../src/publish-rc') - return cmd(argv) - } -} diff --git a/cmds/release.js b/cmds/release.js deleted file mode 100644 index b88aebb5c..000000000 --- a/cmds/release.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' - -module.exports = { - command: 'release', - desc: 'Release your code onto the world', - builder: { - target: { - alias: 't', - describe: 'In which target environment to execute the tests', - type: 'array', - choices: ['node', 'browser', 'webworker'], - default: ['node', 'browser', 'webworker'] - }, - build: { - describe: 'Run build tasks before release', - type: 'boolean', - default: true - }, - test: { - describe: 'Run test tasks before release', - type: 'boolean', - default: true - }, - lint: { - describe: 'Run lint task before release', - type: 'boolean', - default: true - }, - contributors: { - describe: 'Update contributors based on the git history', - type: 'boolean', - default: true - }, - bump: { - describe: 'Bump the package version', - type: 'boolean', - default: true - }, - changelog: { - describe: 'Generate or update the CHANGELOG.md', - type: 'boolean', - default: true - }, - publish: { - describe: 'Publish to npm', - type: 'boolean', - default: true - }, - commit: { - describe: 'Commit changes to git', - type: 'boolean', - default: true - }, - tag: { - describe: 'Create release tag in git', - type: 'boolean', - default: true - }, - push: { - describe: 'Push changes to GitHub', - type: 'boolean', - default: true - }, - ghrelease: { - describe: 'Generate GitHub release', - type: 'boolean', - default: true - }, - docs: { - describe: 'Generate and publish documentation', - type: 'boolean', - default: true - }, - ghtoken: { - describe: 'Access token for generating GitHub releases', - type: 'string', - default: '' - }, - type: { - describe: 'The type of version bump for this release', - type: 'string', - choices: ['major', 'minor', 'patch', 'prepatch', 'preminor', 'premajor', 'prerelease'], - default: 'patch' - }, - preid: { - describe: 'The prerelease identifier', - type: 'string' - }, - files: { - alias: 'f', - describe: 'Custom globs for files to test', - type: 'array', - default: [] - }, - exit: { - describe: 'force shutdown of the event loop after test run: mocha will call process.exit', - type: 'boolean', - default: true - }, - 'dist-tag': { - describe: 'The npm tag to publish to', - type: 'string' - } - }, - handler (argv) { - const release = require('../src/release') - return release(argv) - } -} diff --git a/cmds/test.js b/cmds/test.js deleted file mode 100644 index 6fdb97c9d..000000000 --- a/cmds/test.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict' - -const EPILOG = ` -By default browser tests run in Chrome headless. -Browser testing with Karma supports options forwarding with '--' for more info check https://karma-runner.github.io/3.0/config/configuration-file.html -` - -module.exports = { - command: 'test', - desc: 'Test your code in different environments', - builder: (yargs) => { - yargs - .epilog(EPILOG) - .example('aegir test -t webworker', 'Run tests in the browser with Karma inside a webworker.') - .example('aegir test -t browser -- --browsers Firefox,Chrome,Safari', 'Tell Karma to run tests in several browsers at the same time.') - .example('aegir test -w -t browser -- --browsers Chrome', 'Debug tests with watch mode and tell Karma to open Chrome in a non-headless mode.') - .example( - 'aegir test -t electron-renderer -- --interactive', - 'Debug electron renderer test with a persistent window.' - ) - .options({ - 100: { - describe: 'Check coverage and validate 100% was covered.', - type: 'boolean', - default: false - }, - target: { - alias: 't', - describe: 'In which target environment to execute the tests', - type: 'array', - choices: ['node', 'browser', 'webworker', 'electron-main', 'electron-renderer'], - default: ['node', 'browser', 'webworker'] - }, - verbose: { - describe: 'Print verbose test output', - type: 'boolean', - default: false - }, - watch: { - alias: 'w', - describe: 'Watch files for changes and rerun tests', - type: 'boolean', - default: false - }, - files: { - alias: 'f', - describe: 'Custom globs for files to test', - type: 'array', - default: [] - }, - parallel: { - alias: 'p', - describe: 'Run tests in parallel (only available in node)', - type: 'boolean', - default: true - }, - timeout: { - describe: 'The default time a single test has to run', - type: 'number', - default: 5000 - }, - exit: { - describe: 'Force shutdown of the event loop after test run: mocha will call process.exit', - type: 'boolean', - default: true - }, - colors: { - describe: 'Enable colors on output (only available in node runs)', - type: 'boolean', - default: true - }, - grep: { - alias: 'g', - type: 'string', - describe: 'Limit tests to those whose names match given pattern' - }, - bail: { - alias: 'b', - describe: 'Mocha should bail once a test fails', - type: 'boolean', - default: false - }, - progress: { - describe: 'Use progress reporters on mocha and karma', - type: 'boolean', - default: false - } - }) - }, - handler (argv) { - const test = require('../src/test') - return test.run(argv) - } -} diff --git a/cmds/update-last-successful-build.js b/cmds/update-last-successful-build.js deleted file mode 100644 index 2a38c45b4..000000000 --- a/cmds/update-last-successful-build.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' - -module.exports = { - command: 'update-last-successful-build', - desc: 'Update last known good build branch', - builder: { - branch: { - describe: 'Which branch to update', - type: 'string', - default: 'build/last-successful' - }, - remote: { - describe: 'Which remote to use', - type: 'string', - default: 'origin' - }, - message: { - describe: 'The message to use when adding the shrinkwrap and yarn.lock file', - type: 'string', - default: 'chore: add lockfiles' - } - }, - handler (argv) { - const cmd = require('../src/update-last-successful-build') - return cmd(argv) - } -} diff --git a/cmds/update-rc.js b/cmds/update-rc.js deleted file mode 100644 index 9b0de6b95..000000000 --- a/cmds/update-rc.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -module.exports = { - command: 'update-rc ', - example: 'update-rc release/v0.38.x', - desc: 'Update a release candidate', - builder: { - branch: { - describe: 'Where the latest release branch is', - type: 'string' - }, - remote: { - describe: 'Which remote to use', - type: 'string', - default: 'origin' - }, - distTag: { - describe: 'The dist tag to publish the rc as', - type: 'string', - default: 'next' - }, - preId: { - describe: 'What to call the rc', - type: 'string', - default: 'rc' - } - }, - handler (argv) { - const cmd = require('../src/update-rc') - return cmd(argv) - } -} diff --git a/cmds/update-release-branch-lockfiles.js b/cmds/update-release-branch-lockfiles.js deleted file mode 100644 index e1289a4b4..000000000 --- a/cmds/update-release-branch-lockfiles.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' - -module.exports = { - command: 'update-release-branch-lockfiles ', - desc: 'Updates the lockfiles for the release branch', - builder: { - branch: { - describe: 'Which branch to update', - type: 'string' - }, - remote: { - describe: 'Which remote to use', - type: 'string', - default: 'origin' - }, - message: { - describe: 'The message to use when adding the shrinkwrap and yarn.lock file', - type: 'string', - default: 'chore: add lockfiles' - } - }, - handler (argv) { - const cmd = require('../src/update-release-branch-lockfiles') - return cmd(argv) - } -} diff --git a/cmds/z-commitlint.js b/cmds/z-commitlint.js deleted file mode 100644 index 59a1a29eb..000000000 --- a/cmds/z-commitlint.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict' -const path = require('path') -const execa = require('execa') -const commitlintTravis = require('../src/checks/commitlint-travis') - -const EPILOG = ` -Supports options forwarding with '--' for more info check https://conventional-changelog.github.io/commitlint/#/reference-cli -` - -module.exports = { - command: 'commitlint', - aliases: ['cl', 'commit'], - desc: 'Run `commitlint` cli with aegir defaults.', - builder: (yargs) => { - yargs - .epilog(EPILOG) - .example('npx aegir commitlint -- -E HUSKY_GIT_PARAMS', 'To use inside a package.json as a Husky commit-msg hook.') - .options({ - travis: { - describe: 'Run `commitlint` in Travis CI mode.', - boolean: true - } - }) - }, - handler (argv) { - if (argv.travis) { - return commitlintTravis() - } - - const input = argv._.slice(1) - const forwardOptions = argv['--'] ? argv['--'] : [] - return execa('commitlint', [ - '--extends', - '@commitlint/config-conventional', - ...input, - ...forwardOptions - ], { - stdio: 'inherit', - localDir: path.join(__dirname, '..'), - preferLocal: true - }) - } -} diff --git a/fixtures.js b/fixtures.js deleted file mode 100644 index 9816c700e..000000000 --- a/fixtures.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('./src/fixtures') diff --git a/md/github-actions.md b/md/github-actions.md new file mode 100644 index 000000000..5ee87523a --- /dev/null +++ b/md/github-actions.md @@ -0,0 +1,83 @@ +Create a new file called `main.yml` inside `.github/workflows` with the following content: + +```yml +name: ci +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx aegir lint + - run: npx aegir ts -p check + # or + # - uses: gozala/typescript-error-reporter-action@v1.0.8 + - run: npx aegir build + - run: npx aegir dep-check + - uses: ipfs/aegir/actions/bundle-size@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + test-node: + needs: check + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + node: [12, 14] + fail-fast: true + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: npm install + - run: npx aegir test -t node --bail --cov + - uses: codecov/codecov-action@v1 + test-chrome: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail --cov + - uses: codecov/codecov-action@v1 + test-firefox: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail -- --browser firefox + test-webkit: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail -- --browser webkit + test-electron-main: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx xvfb-maybe aegir test -t electron-main --bail + test-electron-renderer: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm install + - run: npx xvfb-maybe aegir test -t electron-renderer --bail +``` \ No newline at end of file diff --git a/md/migration-to-v31.md b/md/migration-to-v31.md new file mode 100644 index 000000000..9be44d5ef --- /dev/null +++ b/md/migration-to-v31.md @@ -0,0 +1,223 @@ +# Migration Guide v31 + +## `typeVersions` should not be used unless strictly necessary + +We started `typeVersions` a while a ago as an hack to allow deep type imports inside the `src` folder, but this makes the TS compiler output wrong import statement in the `.d.ts` . + +Look into the link bellow for more info: + +- [https://github.com/ipfs/aegir/pull/717](https://github.com/ipfs/aegir/pull/717) +- [https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md#getting-started](https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md#getting-started) + +Actions: + +- Remove typeVersions and do a major release + +## `aegir ts -p docs` was removed in favor of `aegir docs` + +More info in this PR [https://github.com/ipfs/aegir/pull/727](https://github.com/ipfs/aegir/pull/727) + +Actions: + +- Change your script to the new command + +## `aegir docs` has a new flag + +The docs command has a new flag `entryPoint` to setup Typedoc, the defaults should work for most repos. + +Actions: + +- If your repo doesn't follow the standard structure change this new options accordingly. The default value is `src/index.js` + +## The `--ts` global flag was renamed to `--ts-repo` + +This flag enable support for repo using typescript, but with the work to improve configuration we ran into some name collision so this needed to be changed. + +Actions: + +- Change your scripts or configuration to the new flag + +> This is a global flag, you can define it in the configuration file once and all the commands will use it + +## Old npm dependencies semver linting removed + +We had this manual rule for a long time, but npm evolved and the current behaviour is exactly what this rule enforced. + +No action necessary + +## Config property `bundlesize.maxSize` removed + +Actions: + +- Update your config to use + +```jsx +{ + build: { + bundlesizeMax: '100kb' + } +} +``` + +## `types.ts` should not be used + +We were using `.ts` files to write complex types instead of using just JSDocs, but this makes the TS compiler parse these files as code files instead of been just types files and that causes problems in the types generated. + +Importing class types from `.js` files into `.ts` files generates the final `.d.ts` with wrong import statements to the source files instead of the types files. + +Actions: + +- Change the extension of all your `.ts` files to `.d.ts` + +The ts command will copy all `.d.ts` inside the `src` folder to the `dist` folder automatically, and there's two new options to configure custom paths when copying files. + +More info here [https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md#3-use-a-typesdts-file](https://github.com/ipfs/aegir/blob/master/md/ts-jsdoc.md#3-use-a-typesdts-file) and here `aegir ts --help` + +## `--node` flag removed + +This flag was used to tell webpack to inject polyfills for node globals and builtins, this is no longer supported because we use esbuild now. + +Actions: + +- remove this flag from your scripts and configuration +- use your aegir configuration file to setup the bundler for the globals and builtin your code needs + +```jsx +// file: node-globals.js +// @ts-nocheck +export const { Buffer } = require('buffer') +export const process = require('process/browser') + +// file: .aegir.js +const esbuild = { + // this will inject all the named exports from 'node-globals.js' as globals + inject: [path.join(__dirname, '../../scripts/node-globals.js')], + plugins: [ + { + name: 'node built ins', // this will make the bundler resolve node builtins to the respective browser polyfill + setup (build) { + build.onResolve({ filter: /^stream$/ }, () => { + return { path: require.resolve('readable-stream') } + }) + } + } + ] +} + +module.exports = { + test: { + browser :{ + config: { + buildConfig: esbuild + } + } + }, + build: { + config: esbuild + } +} +``` + +- test your browser bundle especially for `process` usage + - the bundler will tell about unresolved packages like `require('fs')` and other errors + - running the browser tests will tell you about node globals that don't exist like `Buffer` + - `process` is special because it's polyfilled by the test runner but not by the bundler in `aegir build` + - `aegir build` only define the var `global` and `process.env.NODE_ENV` if you code needs process.nextTick etc you need to polyfill the full process object + +## Loading fixtures for browser tests + +The new browser test runner automatically serves the current folder (`process.cwd()`) to be accessible through HTTP. + +If you need to customise the folder to be served by the test runner use this config option `test.browser.config.assets` + +## Running tests in the browser + +Check the options for the new test runner here [https://github.com/hugomrdias/playwright-test#options](https://github.com/hugomrdias/playwright-test#options) these be forward directly from aegir + +Actions: + +- change from `aegir test -t browser -- --browsers FirefoxHeadless` to `aegir test -t browser -- --browser firefox` (options are: chromium, firefox, webkit) +- debug mode `aegir test -t browser -- --debug` + +## Codecov uploads + +There's no need to use nyc to instrument and generate reports for codecov anymore + +Action: + +- just add the `--cov` flag to your tests command + +## Some flags were removed from node mocha test command + +- —exit check what this did here [https://mochajs.org/#-exit](https://mochajs.org/#-exit), if you really need this (you shouldn't!) you can forward from aegir `aegir test -t node -- --exit` +- —invert this flag was mute because we didn't support the —fgrep flag, as always you can still forward it to mocha +- —verbose flag was removed mocha doesn't support it anymore +- —color was removed we always want pretty stuff 😂 +- —parallel was removed never worked + +## `fixtures` download util was moved to the utils folder + +Actions: + +- update your requires from `require('aegir/fixtures')` to `require('aegir/utils/fixture')` + +## git-validate removed from dependencies + +Actions: + +- you need to use git-validate or husky in your repo to continue using git hooks + +## commit-lint command removed + +We already discussed the usage of commit-lint and decided to stop using it. + +Actions: + +- remove commil-lint from you scripts + +## Hooks + +Hooks were removed in favor of two new test hooks `before` and `after` + +Actions: + +```jsx +// before +module.exports = { + hooks: { + async pre () { + await Promise.resolve() + + return 'pre done async' + }, + async post () { + await Promise.resolve() + + return 'post done async' + } + } +}; + +// now +module.exports = { + test: { + async before (testOptions) { + if(testOptions.runner === 'node') { + // run node specific setup + } + if(testOptions.runner === 'browser') { + // run browser specific setup + } + const server = new Server() + await server.start() + return { + env: { SERVER_URL: server.endpoint } + server +  } + }, + async after (testOptions, beforeReturn) { + await beforeReturn.server.stop() + } + } +}; +``` diff --git a/md/ts-jsdoc.md b/md/ts-jsdoc.md index 364ee2cb2..f658d0190 100644 --- a/md/ts-jsdoc.md +++ b/md/ts-jsdoc.md @@ -246,6 +246,9 @@ const fs = require('fs') [Typescript official performance notes](https://github.com/microsoft/TypeScript/wiki/Performance) [TypeScript: Don’t Export const enums](https://ncjamieson.com/dont-export-const-enums/) [TypeScript: Prefer Interfaces](https://ncjamieson.com/prefer-interfaces/) +[Typescript Narrowing](https://www.typescriptlang.org/docs/handbook/2/narrowing.html) ## Resources -[TS with JSDoc Discussions](https://github.com/voxpelli/types-in-js) \ No newline at end of file +[TS with JSDoc Discussions](https://github.com/voxpelli/types-in-js) +[Tackling Typescript](https://exploringjs.com/tackling-ts/toc.html) +[Effective Typescript](https://effectivetypescript.com/) \ No newline at end of file diff --git a/package.json b/package.json index 809acc069..3d3bc54fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aegir", - "version": "30.3.0", + "version": "31.0.0-next.2", "description": "JavaScript project management", "keywords": [ "webpack", @@ -13,81 +13,73 @@ "license": "MIT", "leadMaintainer": "Hugo Dias ", "files": [ - "dist/utils", + "dist", "cmds", "utils", "src", - "cli.js", - "fixtures.js" + "cli.js" ], "main": "cli.js", "browser": { "fs": false, - "./src/fixtures.js": "./src/fixtures.browser.js" + "./utils/fixtures.js": "./utils/fixtures.browser.js" }, "bin": { "aegir": "cli.js" }, + "types": "dist/src/index", "typesVersions": { "*": { "utils/*": [ "dist/utils/*" + ], + "src/*": [ + "dist/src/*", + "dist/src/*/index" + ], + "src/": [ + "dist/src/index" ] } }, "repository": "github:ipfs/aegir", "scripts": { - "prepare": "tsc -p tsconfig-types.json", + "prepare": "node cli.js ts -p types", "lint": "node cli.js lint", + "test": "node cli.js ts -p check && node cli.js test", "test:node": "node cli.js test -t node", - "test:browser": "node cli.js test -t browser webworker", - "test:acceptance": "./test/acceptance.sh", - "test": "npm run test:node && npm run test:browser", - "coverage": "node cli.js coverage -t node", - "watch": "node cli.js test -t node --watch", - "release": "node cli.js release --no-docs --no-test --no-build", - "release-minor": "node cli.js release --no-docs --no-build --no-test --type minor", - "release-major": "node cli.js release --no-docs --no-build --no-test --type major" + "test:browser": "node cli.js test -t browser -t webworker", + "release": "node cli.js release", + "release-minor": "node cli.js release --type minor", + "release-major": "node cli.js release --type major" }, "dependencies": { "@achingbrain/dependency-check": "^4.1.0", - "@babel/cli": "^7.12.10", - "@babel/core": "^7.12.10", - "@babel/plugin-transform-regenerator": "^7.12.1", - "@babel/plugin-transform-runtime": "^7.12.10", - "@babel/preset-env": "^7.12.10", - "@babel/preset-typescript": "^7.12.7", - "@babel/register": "^7.12.10", - "@babel/runtime": "^7.12.5", - "@commitlint/cli": "^11.0.0", - "@commitlint/config-conventional": "^11.0.0", - "@commitlint/lint": "^11.0.0", - "@commitlint/load": "^11.0.0", - "@commitlint/read": "^11.0.0", - "@commitlint/travis-cli": "^11.0.0", "@electron/get": "^1.12.3", "@polka/send-type": "^0.5.2", - "@types/chai": "^4.2.14", + "@types/chai": "^4.2.15", "@types/chai-as-promised": "^7.1.3", "@types/chai-subset": "^1.3.3", "@types/dirty-chai": "^2.0.2", "@types/mocha": "^8.2.0", - "@types/node": "^14.14.22", + "@types/node": "^14.14.28", "@types/sinon": "^9.0.10", - "babel-loader": "^8.2.2", "buffer": "^6.0.3", "bytes": "^3.1.0", + "c8": "^7.5.0", "camelcase": "^6.2.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "chai-subset": "^1.6.0", - "chalk": "^4.1.0", "conventional-changelog": "^3.1.24", "conventional-github-releaser": "^3.1.5", "copyfiles": "^2.4.1", "cors": "^2.8.5", "dirty-chai": "^2.0.1", "electron-mocha": "^10.0.0", + "env-paths": "^2.2.0", + "esbuild": "^0.8.46", + "esbuild-register": "^2.0.0", "eslint": "^7.18.0", "eslint-config-ipfs": "^2.0.0", "execa": "^5.0.0", @@ -95,63 +87,54 @@ "fs-extra": "^9.1.0", "gh-pages": "^3.1.0", "git-authors-cli": "^1.0.33", - "git-validate": "^2.2.4", "globby": "^11.0.2", "ipfs-utils": "^6.0.0", "it-glob": "~0.0.10", - "json-loader": "~0.5.7", - "karma": "^6.0.3", - "karma-chrome-launcher": "^3.1.0", - "karma-cli": "^2.0.0", - "karma-firefox-launcher": "^2.1.0", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-mocha-webworker": "^1.3.0", - "karma-sourcemap-loader": "~0.3.8", - "karma-webpack": "4.0.2", + "kleur": "^4.1.4", "lilconfig": "^2.0.2", "listr": "~0.14.2", "merge-options": "^3.0.4", - "mocha": "^8.2.1", + "mocha": "^8.3.0", "npm-package-json-lint": "^5.1.0", "nyc": "^15.1.0", "ora": "^5.3.0", "p-map": "^4.0.0", "pascalcase": "^1.0.0", + "playwright-test": "^2.0.0", "polka": "^0.5.2", "premove": "^3.0.1", - "prompt-promise": "^1.0.3", + "proper-lockfile": "^4.1.2", "read-pkg-up": "^7.0.1", "semver": "^7.3.4", "simple-git": "^2.28.0", "strip-bom": "^4.0.0", "strip-json-comments": "^3.1.1", - "terser-webpack-plugin": "^3.0.5", - "typedoc": "^0.20.17", - "typescript": "4.1.x", + "tempy": "^1.0.0", + "typedoc": "^0.20.25", + "typescript": "4.1.5", "update-notifier": "^5.0.0", - "webpack": "^4.43.0", - "webpack-bundle-analyzer": "^3.7.0", - "webpack-cli": "^3.3.10", - "webpack-merge": "^4.2.2", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.3" + "yargs": "^16.2.0" }, "devDependencies": { "@types/bytes": "^3.1.0", + "@types/conventional-changelog": "^3.1.0", + "@types/cors": "^2.8.10", "@types/eslint": "^7.2.6", - "@types/fs-extra": "^9.0.6", + "@types/fs-extra": "^9.0.7", "@types/gh-pages": "^3.0.0", "@types/listr": "^0.14.2", + "@types/pascalcase": "^1.0.0", "@types/polka": "^0.5.2", + "@types/proper-lockfile": "^4.1.1", "@types/semver": "^7.3.4", + "@types/update-notifier": "^5.0.0", "@types/yargs": "^16.0.0", "electron": "^11.2.0", "iso-url": "^1.0.0", "sinon": "^9.2.3" }, "engines": { - "node": ">=12.0.0", + "node": ">=14.0.0", "npm": ">=6.0.0" }, "browserslist": [ diff --git a/src/build/index.js b/src/build/index.js index 37e3933a8..3371e52d9 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -1,18 +1,22 @@ /* eslint-disable no-console */ 'use strict' - +const Listr = require('listr') +const esbuild = require('esbuild') const path = require('path') -const { readJsonSync } = require('fs-extra') +const pascalcase = require('pascalcase') const bytes = require('bytes') -const execa = require('execa') const { premove: del } = require('premove') -const { fromAegir, gzipSize, pkg, hasTsconfig } = require('./../utils') +const { gzipSize, pkg, hasTsconfig, fromRoot, paths } = require('./../utils') const tsCmd = require('../ts') -const { userConfig } = require('../config/user') +const merge = require('merge-options').bind({ + ignoreUndefined: true, + concatArrays: true +}) /** * @typedef {import("../types").GlobalOptions} GlobalOptions * @typedef {import("../types").BuildOptions} BuildOptions + * @typedef {import("listr").ListrTaskWrapper} Task */ /** @@ -20,65 +24,97 @@ const { userConfig } = require('../config/user') * * @param {GlobalOptions & BuildOptions} argv */ -module.exports = async (argv) => { - const input = argv._.slice(1) - const forwardOptions = argv['--'] ? argv['--'] : [] - const useBuiltinConfig = !forwardOptions.includes('--config') - const progress = !forwardOptions.includes('--progress') && !process.env.CI ? ['--progress'] : [] - const webpackConfig = useBuiltinConfig - ? ['--config', fromAegir('src/config/webpack.config.js')] - : [] +const build = async (argv) => { + const outfile = path.join(paths.dist, 'index.min.js') + const globalName = pascalcase(pkg.name) + const umdPre = ` + (function (root, factory) { + if (typeof module === 'object' && module.exports) { + module.exports = factory(); + } else { + root.${globalName} = factory(); + } +}(typeof self !== 'undefined' ? self : this, function () { +` + const umdPost = ` +return ${globalName}; +})); +` + await esbuild.build(merge( + { + entryPoints: [fromRoot('src', argv.tsRepo ? 'index.ts' : 'index.js')], + bundle: true, + format: 'iife', + mainFields: ['browser', 'module', 'main'], + sourcemap: argv.bundlesize, + minify: true, + globalName, + banner: umdPre, + footer: umdPost, + metafile: argv.bundlesize ? path.join(paths.dist, 'stats.json') : undefined, + outfile, + define: { + global: 'globalThis', + 'process.env.NODE_ENV': '"production"' + } + }, + argv.fileConfig.build.config + )) - // Clean dist - await del(path.join(process.cwd(), 'dist')) + return outfile +} - if (argv.bundle) { - // Run webpack - await execa('webpack-cli', [ - ...webpackConfig, - ...progress, - ...input, - ...forwardOptions - ], { - env: { - NODE_ENV: process.env.NODE_ENV || 'production', - AEGIR_BUILD_ANALYZE: argv.bundlesize ? 'true' : 'false', - AEGIR_NODE: argv.node ? 'true' : 'false', - AEGIR_TS: argv.tsRepo ? 'true' : 'false' - }, - localDir: path.join(__dirname, '../..'), - preferLocal: true, - stdio: 'inherit' - }) +const tasks = new Listr([ + { + title: 'Clean ./dist', + task: async () => del(path.join(process.cwd(), 'dist')) + }, + { + title: 'Bundle', + enabled: ctx => ctx.bundle, + /** + * + * @param {GlobalOptions & BuildOptions} ctx + * @param {Task} task + */ + task: async (ctx, task) => { + const outfile = await build(ctx) - if (argv.bundlesize) { - // @ts-ignore - if (userConfig.bundlesize?.maxSize) { - throw new Error('Config property `bundlesize.maxSize` is deprecated, use `build.bundlesizeMax`!') - } - const stats = readJsonSync(path.join(process.cwd(), 'dist/stats.json')) - const gzip = await gzipSize(path.join(stats.outputPath, stats.assets[0].name)) - const maxsize = bytes(userConfig.build.bundlesizeMax) - const diff = gzip - maxsize + if (ctx.bundlesize) { + const gzip = await gzipSize(outfile) + const maxsize = bytes(ctx.bundlesizeMax) + const diff = gzip - maxsize - console.log('Use http://webpack.github.io/analyse/ to load "./dist/stats.json".') - console.log(`Check previous sizes in https://bundlephobia.com/result?p=${pkg.name}@${pkg.version}`) + task.output = 'Use https://www.bundle-buddy.com/ to load "./dist/stats.json".' + task.output = `Check previous sizes in https://bundlephobia.com/result?p=${pkg.name}@${pkg.version}` - if (diff > 0) { - throw new Error(`${bytes(gzip)} (▲${bytes(diff)} / ${bytes(maxsize)})`) - } else { - console.log(`${bytes(gzip)} (▼${bytes(diff)} / ${bytes(maxsize)})`) + if (diff > 0) { + throw new Error(`${bytes(gzip)} (▲${bytes(diff)} / ${bytes(maxsize)})`) + } else { + task.output = `${bytes(gzip)} (▼${bytes(diff)} / ${bytes(maxsize)})` + } } } + }, + { + title: 'Generate types', + enabled: ctx => ctx.types && hasTsconfig, + /** + * @param {GlobalOptions & BuildOptions} ctx + * @param {Task} task + */ + task: async (ctx, task) => { + await tsCmd({ + debug: ctx.debug, + tsRepo: ctx.tsRepo, + fileConfig: ctx.fileConfig, + preset: 'types', + include: ctx.fileConfig.ts.include, + copyTo: ctx.fileConfig.ts.copyTo, + copyFrom: ctx.fileConfig.ts.copyFrom + }) + } } +], { renderer: 'verbose' }) - if (argv.types && hasTsconfig) { - await tsCmd({ - ...argv, - preset: 'types', - include: userConfig.ts.include, - copyTo: userConfig.ts.copyTo, - copyFrom: userConfig.ts.copyFrom - }) - } -} +module.exports = tasks diff --git a/src/checks/commitlint-travis.js b/src/checks/commitlint-travis.js deleted file mode 100644 index d55a9554b..000000000 --- a/src/checks/commitlint-travis.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict' - -const execa = require('execa') -const commitlint = require('@commitlint/cli') - -// Allow to override used bins for testing purposes -const GIT = process.env.TRAVIS_COMMITLINT_GIT_BIN || 'git' -const COMMITLINT = process.env.TRAVIS_COMMITLINT_BIN - -const REQUIRED = [ - 'TRAVIS_COMMIT', - 'TRAVIS_COMMIT_RANGE', - 'TRAVIS_EVENT_TYPE', - 'TRAVIS_REPO_SLUG', - 'TRAVIS_PULL_REQUEST_SLUG' -] - -const COMMIT = process.env.TRAVIS_COMMIT -const REPO_SLUG = process.env.TRAVIS_REPO_SLUG -const PR_SLUG = process.env.TRAVIS_PULL_REQUEST_SLUG || REPO_SLUG -const RANGE = process.env.TRAVIS_COMMIT_RANGE -const IS_PR = process.env.TRAVIS_EVENT_TYPE === 'pull_request' - -module.exports = async function main () { - validate() - - // Stash changes in working copy if needed - const pop = await stash() - - // Make base and source available as dedicated remotes - await Promise.all([ - () => fetch({ name: 'base', url: `https://github.com/${REPO_SLUG}.git` }), - IS_PR - ? () => fetch({ name: 'source', url: `https://github.com/${PR_SLUG}.git` }) - : async () => {} - ]) - - // Restore stashed changes if any - await pop() - - // Lint all commits in TRAVIS_COMMIT_RANGE if available - if (IS_PR && RANGE) { - const [start, end] = RANGE.split('.').filter(Boolean) - await lint(['--from', start, '--to', end]) - } else { - const input = await log(COMMIT) - await lint([], { input }) - } -} - -function git (args, options) { - return execa(GIT, args, Object.assign({}, { stdio: 'inherit' }, options)) -} - -async function fetch ({ name, url }) { - await git(['remote', 'add', name, url]) - await git(['fetch', name, '--quiet']) -} - -async function isClean () { - const result = await git(['status', '--porcelain'], { - stdio: ['pipe', 'pipe', 'pipe'] - }) - return !(result.stdout && result.stdout.trim()) -} - -function lint (args, options) { - return execa( - COMMITLINT || commitlint, - [ - '--extends', - '@commitlint/config-conventional', - ...args - ], - Object.assign({}, { stdio: ['pipe', 'inherit', 'inherit'] }, options) - ) -} - -async function log (hash) { - const result = await execa('git', [ - 'log', - '-n', - '1', - '--pretty=format:%B', - hash - ]) - return result.stdout -} - -async function stash () { - if (await isClean()) { - return async () => {} - } - await git(['stash', '-k', '-u', '--quiet']) - return () => git(['stash', 'pop', '--quiet']) -} - -function validate () { - if (process.env.CI !== 'true' || process.env.TRAVIS !== 'true') { - throw new Error( - '@commitlint/travis-cli is intended to be used on Travis CI' - ) - } - - const missing = REQUIRED.filter(envVar => !(envVar in process.env)) - - if (missing.length > 0) { - const stanza = missing.length > 1 ? 'they were not' : 'it was not' - throw new Error( - `Expected ${missing.join(', ')} to be defined globally, ${stanza}.` - ) - } -} diff --git a/cmds/build.js b/src/cmds/build.js similarity index 70% rename from cmds/build.js rename to src/cmds/build.js index bb933ce0a..54b4e608b 100644 --- a/cmds/build.js +++ b/src/cmds/build.js @@ -1,12 +1,11 @@ 'use strict' -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') /** * @typedef {import("yargs").Argv} Argv * @typedef {import("yargs").Arguments} Arguments */ const EPILOG = ` Output files will go into a "./dist" folder. -Supports options forwarding with '--' for more info check https://webpack.js.org/api/cli/ ` module.exports = { command: 'build', @@ -26,12 +25,11 @@ module.exports = { bundlesize: { alias: 'b', type: 'boolean', - describe: 'Analyse bundle size. Default threshold is 100kB, you can override that in `.aegir.js` with the property `bundlesize.maxSize`.', + describe: 'Analyse bundle size.', default: userConfig.build.bundlesize }, bundlesizeMax: { - alias: 'b', - type: 'boolean', + type: 'string', describe: 'Max threshold for the bundle size.', default: userConfig.build.bundlesizeMax }, @@ -43,11 +41,10 @@ module.exports = { }) }, /** - * - * @param {Arguments} argv + * @param {(import("../types").GlobalOptions & import("../types").BuildOptions) | undefined} argv */ handler (argv) { - const build = require('../src/build') - return build(argv) + const build = require('../build') + return build.run(argv) } } diff --git a/src/cmds/check.js b/src/cmds/check.js new file mode 100644 index 000000000..99c4d0e8d --- /dev/null +++ b/src/cmds/check.js @@ -0,0 +1,190 @@ +/* eslint-disable guard-for-in */ +/* eslint-disable max-depth */ +/* eslint-disable no-console */ +'use strict' +const esbuild = require('esbuild') +const fs = require('fs-extra') +const findPkg = require('read-pkg-up') +const kleur = require('kleur') +const { userConfig } = require('../config/user') +const path = require('path') +const { fromRoot, paths } = require('../utils') +const merge = require('merge-options').bind({ + ignoreUndefined: true, + concatArrays: true +}) +module.exports = { + command: 'check', + desc: 'Check project', + builder: {}, + /** + * @param {any} argv + */ + handler (argv) { + return checkBuiltins(argv) + } +} + +/** + * @param {{ tsRepo: any; }} argv + */ +const checkBuiltins = async (argv) => { + const outfile = path.join(paths.dist, 'index.js') + const metafile = path.join(paths.dist, 'stats.json') + /** @type {Record} */ + const nodeBuiltIns = { + util: [], + sys: [], + events: [], + stream: [], + path: [], + querystring: [], + punycode: [], + url: [], + string_decoder: [], + http: [], + https: [], + os: [], + assert: [], + constants: [], + timers: [], + vm: [], + zlib: [], + tty: [], + domain: [] + } + const nodePlugin = { + name: 'node built ins', + /** + * + * @param {import('esbuild').PluginBuild} build + */ + setup (build) { + for (const k of Object.keys(nodeBuiltIns)) { + build.onResolve({ filter: new RegExp(`^${k}$`) }, (args) => { + nodeBuiltIns[k].push(args.importer) + return null + }) + } + } + } + + await esbuild.build( + merge( + { + entryPoints: [ + fromRoot('src', argv.tsRepo ? 'index.ts' : 'index.js') + ], + bundle: true, + mainFields: ['browser', 'module', 'main'], + sourcemap: true, + minify: false, + metafile, + outfile, + plugins: [nodePlugin], + define: { + 'process.env.NODE_ENV': '"production"' + } + }, + userConfig.build.config + ) + ) + + const { outputs } = fs.readJSONSync(metafile) + + await findBuiltins(nodeBuiltIns) + findDuplicates(outputs['dist/index.js'].inputs) +} + +/** + * @param {{}} inputs + */ +const findDuplicates = async (inputs) => { + const files = Object.keys(inputs) + /** @type {Record>} */ + const packages = {} + for (const file of files) { + if (file.includes('node_modules') && !file.includes('empty:')) { + const parts = file.split('/') + const last = parts.lastIndexOf('node_modules') + let name + let path + if (parts[last + 1].startsWith('@')) { + name = parts[last + 1] + '/' + parts[last + 2] + path = parts.slice(0, last + 3) + } else { + name = parts[last + 1] + path = parts.slice(0, last + 2) + } + + if (packages[name]) { + packages[name].add(path.join('/')) + } else { + packages[name] = new Set() + packages[name].add(path.join('/')) + } + } + } + + // we have all the packages + console.log(kleur.red('Dependencies duplication')) + for (const key in packages) { + const imports = packages[key] + if (imports.size > 1) { + console.log(kleur.red(key)) + for (const file of imports) { + const out = await findPkg({ cwd: file }) + if (out) { + console.log(kleur.dim(file), kleur.blue(out.packageJson.version)) + } + } + } + } +} + +/** + * @param {Record} nodeBuiltIns + */ +const findBuiltins = async (nodeBuiltIns) => { + /** @type {Record>} */ + const packages = {} + // eslint-disable-next-line guard-for-in + for (const builtin in nodeBuiltIns) { + for (const importer of nodeBuiltIns[builtin]) { + const out = await findPkg({ cwd: importer }) + let isOk = false + if (out) { + if (out.packageJson.dependencies) { + const deps = Object.keys(out.packageJson.dependencies) + if (deps.includes(builtin)) { + isOk = true + } + } + + if (!isOk && out.packageJson.browser) { + const deps = Object.keys(out.packageJson.browser) + if (deps.includes(builtin)) { + isOk = true + } + } + } + if (!isOk) { + if (!packages[builtin]) { + packages[builtin] = new Set() + } + const relativePath = path.relative( + process.cwd(), + importer + ) + packages[builtin].add(relativePath) + } + } + } + + if (Object.keys(packages).length > 0) { + console.log(kleur.red('Files missing node built-ins dependencies')) + console.log(packages) + } else { + console.log(kleur.green('All inputs register dependencies or polyfills for node built-ins.')) + } +} diff --git a/cmds/docs.js b/src/cmds/docs.js similarity index 80% rename from cmds/docs.js rename to src/cmds/docs.js index a091837a3..fa16f83a5 100644 --- a/cmds/docs.js +++ b/src/cmds/docs.js @@ -1,6 +1,8 @@ 'use strict' -const { userConfig } = require('../src/config/user') - +const { userConfig } = require('../config/user') +/** + * @typedef {import("yargs").Argv} Argv + */ const EPILOG = ` Typescript config file is required to generated docs. Try \`aegir ts --preset config > tsconfig.json\` ` @@ -8,6 +10,9 @@ Typescript config file is required to generated docs. Try \`aegir ts --preset co module.exports = { command: 'docs', desc: 'Generate documentation from TS type declarations.', + /** + * @param {Argv} yargs + */ builder: yargs => { yargs .epilog(EPILOG) @@ -29,8 +34,11 @@ module.exports = { } ) }, + /** + * @param {(import("../types").GlobalOptions & import("../types").DocsOptions) | undefined} argv + */ handler (argv) { - const docs = require('../src/docs') + const docs = require('../docs') return docs.run(argv) } } diff --git a/src/cmds/lint.js b/src/cmds/lint.js new file mode 100644 index 000000000..c022297d6 --- /dev/null +++ b/src/cmds/lint.js @@ -0,0 +1,49 @@ +'use strict' +const { userConfig } = require('../config/user') + +/** + * @typedef {import("yargs").Argv} Argv + * @typedef {import("yargs").Arguments} Arguments + */ + +const EPILOG = ` +Linting uses eslint (http://eslint.org/) and standard(https://github.com/feross/standard) +with some custom rules(https://github.com/ipfs/eslint-config-aegir) to enforce some more strictness. +` + +module.exports = { + command: 'lint', + desc: 'Lint all project files', + /** + * @param {Argv} yargs + */ + builder: (yargs) => { + yargs + .epilog(EPILOG) + .options({ + fix: { + alias: 'f', + type: 'boolean', + describe: 'Automatically fix errors if possible.', + default: userConfig.lint.fix + }, + files: { + type: 'array', + describe: 'Files to lint.', + default: userConfig.lint.files + }, + silent: { + type: 'boolean', + describe: 'Disable eslint output.', + default: userConfig.lint.silent + } + }) + }, + /** + * @param {(import("../types").GlobalOptions & import("../types").LintOptions) | undefined} argv + */ + handler (argv) { + const lint = require('../lint') + return lint.run(argv) + } +} diff --git a/src/cmds/release.js b/src/cmds/release.js new file mode 100644 index 000000000..53d97a739 --- /dev/null +++ b/src/cmds/release.js @@ -0,0 +1,131 @@ +'use strict' + +const { userConfig } = require('../config/user') +/** + * @typedef {import("yargs").Argv} Argv + * @typedef {import("yargs").Arguments} Arguments + */ + +const EPILOG = ` +Performing a release involves creating new commits and tags and then pushing them back to the repository you are releasing from. In order to do this you should create a [GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) and store it in the environmental variable "AEGIR_GHTOKEN". + +The only access scope it needs is "public_repo". + +Be aware that by storing it in "~/.profile" or similar you will make it available to any program that runs on your computer. +` +module.exports = { + command: 'release', + desc: 'Release your code onto the world', + /** + * @param {Argv} yargs + */ + builder: (yargs) => { + yargs + .epilog(EPILOG) + .example('aegir release --type major', 'Major release') + .example('aegir release --type premajor --preid rc --dist-tag next', 'Major prerelease (1.0.0 -> 2.0.0-rc.0)') + .example('aegir release --type prerelease --preid rc --dist-tag next', 'Increment prerelease (2.0.0-rc.0 -> 2.0.0-rc.1)') + .options( + { + build: { + describe: 'Run build tasks before release', + type: 'boolean', + default: userConfig.release.build + }, + test: { + describe: 'Run test tasks before release', + type: 'boolean', + default: userConfig.release.test + }, + lint: { + describe: 'Run lint task before release', + type: 'boolean', + default: userConfig.release.lint + }, + types: { + describe: 'Run type check task before release', + type: 'boolean', + default: userConfig.release.types + }, + contributors: { + describe: 'Update contributors based on the git history', + type: 'boolean', + default: userConfig.release.contributors + }, + bump: { + describe: 'Bump the package version', + type: 'boolean', + default: userConfig.release.bump + }, + changelog: { + describe: 'Generate or update the CHANGELOG.md', + type: 'boolean', + default: userConfig.release.changelog + }, + publish: { + describe: 'Publish to npm', + type: 'boolean', + default: userConfig.release.publish + }, + commit: { + describe: 'Commit changes to git', + type: 'boolean', + default: userConfig.release.commit + }, + tag: { + describe: 'Create release tag in git', + type: 'boolean', + default: userConfig.release.tag + }, + push: { + describe: 'Push changes to GitHub', + type: 'boolean', + default: userConfig.release.push + }, + ghrelease: { + describe: 'Generate GitHub release', + type: 'boolean', + default: userConfig.release.ghrelease + }, + docs: { + describe: 'Generate and publish documentation', + type: 'boolean', + default: userConfig.release.docs + }, + ghtoken: { + describe: 'Access token for generating GitHub releases', + type: 'string', + default: userConfig.release.ghtoken + }, + type: { + describe: 'The type of version bump for this release', + type: 'string', + choices: ['major', 'minor', 'patch', 'prepatch', 'preminor', 'premajor', 'prerelease'], + default: userConfig.release.type + }, + preid: { + describe: 'The prerelease identifier', + type: 'string', + default: userConfig.release.preid + }, + 'dist-tag': { + describe: 'The npm tag to publish to', + type: 'string', + default: userConfig.release.distTag + }, + remote: { + describe: 'Git remote', + type: 'string', + default: userConfig.release.remote + } + } + ) + }, + /** + * @param {import("../types").GlobalOptions & import("../types").ReleaseOptions} argv + */ + handler (argv) { + const release = require('../release') + return release(argv) + } +} diff --git a/cmds/test-dependant.js b/src/cmds/test-dependant.js similarity index 80% rename from cmds/test-dependant.js rename to src/cmds/test-dependant.js index b5e8659b1..e88c218ea 100644 --- a/cmds/test-dependant.js +++ b/src/cmds/test-dependant.js @@ -18,11 +18,16 @@ module.exports = { }, deps: { describe: 'Other dependencies to override, e.g. --deps=foo@1.5.0,bar@2.4.1', + /** + * + * @param {string} val + */ coerce: (val) => { if (typeof val !== 'string') { return {} } + /** @type {Record} */ const deps = {} for (const dep of val.split(',')) { @@ -35,8 +40,11 @@ module.exports = { default: {} } }, + /** + * @param {{ repo: string; branch: string; deps: any; }} argv + */ handler (argv) { - const cmd = require('../src/test-dependant') + const cmd = require('../test-dependant') return cmd(argv) } } diff --git a/src/cmds/test.js b/src/cmds/test.js new file mode 100644 index 000000000..533b94fa0 --- /dev/null +++ b/src/cmds/test.js @@ -0,0 +1,96 @@ +'use strict' +const { userConfig } = require('../config/user') +/** + * @typedef {import("yargs").Argv} Argv + */ + +const EPILOG = ` +By default browser tests run in Chromium headless. +Testing supports options forwarding with '--' for more info check https://github.com/hugomrdias/playwright-test#options, https://mochajs.org/#command-line-usage or https://github.com/jprichardson/electron-mocha#run-tests. +` + +module.exports = { + command: 'test', + desc: 'Test your code in different environments', + /** + * @param {Argv} yargs + */ + builder: (yargs) => { + yargs + .epilog(EPILOG) + .example( + 'aegir test -t webworker', + 'Run tests in the browser inside a webworker.' + ) + .example( + 'aegir test -t browser -- --browser firefox', + 'Tell `playwright-test` to run tests in firefox.' + ) + .example( + 'aegir test -w -t browser -- --browser webkit --debug', + 'Debug tests with watch mode and tell `playwright-test` to open webkit in a non-headless mode.' + ) + .example( + 'aegir test -t electron-renderer -- --interactive', + 'Debug electron renderer test with a persistent window.' + ) + .example( + 'aegir test -t node --cov && npx nyc report', + 'Run test with coverage enabled and report to the terminal.' + ) + .options({ + target: { + alias: 't', + describe: 'In which target environment to execute the tests', + type: 'array', + choices: ['node', 'browser', 'webworker', 'electron-main', 'electron-renderer'], + default: userConfig.test.target + }, + watch: { + alias: 'w', + describe: 'Watch files for changes and rerun tests', + type: 'boolean', + default: userConfig.test.watch + }, + files: { + alias: 'f', + describe: 'Custom globs for files to test', + type: 'array', + default: userConfig.test.files + }, + timeout: { + describe: 'The default time a single test has to run', + type: 'number', + default: userConfig.test.timeout + }, + grep: { + alias: 'g', + type: 'string', + describe: 'Limit tests to those whose names match given pattern' + }, + bail: { + alias: 'b', + describe: 'Mocha should bail once a test fails', + type: 'boolean', + default: userConfig.test.bail + }, + progress: { + describe: 'Use progress reporters on mocha and karma', + type: 'boolean', + default: userConfig.test.progress + }, + cov: { + describe: 'Enable coverage output. Output is already in Istanbul JSON format and can be uploaded directly to codecov.', + type: 'boolean', + default: userConfig.test.cov + } + }) + }, + /** + * @param {import("../types").TestOptions & import("../types").GlobalOptions} argv + */ + handler (argv) { + const test = require('../test') + return test.run(argv) + } +} diff --git a/cmds/ts.js b/src/cmds/ts.js similarity index 77% rename from cmds/ts.js rename to src/cmds/ts.js index 49d0754e4..c14b908de 100644 --- a/cmds/ts.js +++ b/src/cmds/ts.js @@ -1,10 +1,14 @@ 'use strict' -const { userConfig } = require('../src/config/user') +const { userConfig } = require('../config/user') +/** + * @typedef {import("yargs").Argv} Argv + * @typedef {import("yargs").Arguments} Arguments + */ const EPILOG = ` Presets: \`check\` Runs the type checker with your local config (without writing any files). . -\`types\` Emits type declarations to \`dist\` folder. +\`types\` Emits type declarations, copies a any .d.ts files or a types folder to \`dist\` folder. \`config\` Prints base config to stdout. Note: @@ -15,6 +19,9 @@ Supports options forwarding with '--' for more info check https://www.typescript module.exports = { command: 'ts', desc: 'Typescript command with presets for specific tasks.', + /** + * @param {Argv} yargs + */ builder: (yargs) => { yargs .epilog(EPILOG) @@ -44,8 +51,11 @@ module.exports = { } }) }, + /** + * @param {import("../types").GlobalOptions & import("../types").TSOptions} argv + */ handler (argv) { - const ts = require('../src/ts') + const ts = require('../ts') return ts(argv) } } diff --git a/cmds/z-dependency-check.js b/src/cmds/z-dependency-check.js similarity index 70% rename from cmds/z-dependency-check.js rename to src/cmds/z-dependency-check.js index a38d9b498..43c0b90f0 100644 --- a/cmds/z-dependency-check.js +++ b/src/cmds/z-dependency-check.js @@ -2,18 +2,22 @@ 'use strict' const ora = require('ora') -const depCheck = require('../src/dependency-check') - +const { userConfig } = require('../config/user') +const { check } = require('../dependency-check') +/** + * @typedef {import("yargs").Argv} Argv + */ const EPILOG = ` Supports options forwarding with '--' for more info check https://github.com/maxogden/dependency-check#cli-usage ` -const commandName = depCheck.commandNames[0] - module.exports = { - command: `${commandName} [input...]`, - aliases: depCheck.commandNames.filter(name => name !== commandName), + command: 'dependency-check [input...]', + aliases: ['dep-check', 'dep'], desc: 'Run `dependency-check` cli with aegir defaults.', + /** + * @param {Argv} yargs + */ builder: (yargs) => { yargs .epilog(EPILOG) @@ -21,27 +25,31 @@ module.exports = { .example('aegir dependency-check -- --unused --ignore typescript', 'To check unused packages in your repo, ignoring typescript.') .positional('input', { describe: 'Files to check', + // @ts-ignore type: 'array', - default: depCheck.defaultInput + default: userConfig.dependencyCheck.input }) .option('p', { alias: 'production-only', describe: 'Check production dependencies and paths only', type: 'boolean', - default: false + default: userConfig.dependencyCheck.productionOnly }) .option('i', { alias: 'ignore', describe: 'Ignore these dependencies when considering which are used and which are not', type: 'array', - default: [] + default: userConfig.dependencyCheck.ignore }) }, + /** + * @param {any} argv + */ async handler (argv) { const spinner = ora('Checking dependencies').start() try { - await depCheck(argv, process.argv) + await check(argv) spinner.succeed() } catch (err) { spinner.fail() diff --git a/cmds/z-lint-package-json.js b/src/cmds/z-lint-package-json.js similarity index 82% rename from cmds/z-lint-package-json.js rename to src/cmds/z-lint-package-json.js index 31281e345..2b14cb2de 100644 --- a/cmds/z-lint-package-json.js +++ b/src/cmds/z-lint-package-json.js @@ -2,8 +2,10 @@ const execa = require('execa') const path = require('path') -const { fromAegir, fromRoot } = require('../src/utils') - +const { fromAegir, fromRoot } = require('../utils') +/** + * @typedef {import("yargs").Argv} Argv + */ const EPILOG = ` Supports options forwarding with '--' for more info check https://github.com/tclindner/npm-package-json-lint#cli-commands-and-configuration ` @@ -12,10 +14,16 @@ module.exports = { command: 'lint-package-json', desc: 'Lint package.json with aegir defaults.', aliases: ['lint-package', 'lpj'], + /** + * @param {Argv} yargs + */ builder: (yargs) => { yargs .epilog(EPILOG) }, + /** + * @param {{ [x: string]: any; _: string | any[]; }} argv + */ handler (argv) { const input = argv._.slice(1) const forwardOptions = argv['--'] ? argv['--'] : [] diff --git a/src/config/babelrc.js b/src/config/babelrc.js deleted file mode 100644 index 65a73d48b..000000000 --- a/src/config/babelrc.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict' -const { pkg, browserslist } = require('./../utils') - -module.exports = function (opts = {}) { - const env = process.env.BABEL_ENV || process.env.NODE_ENV - const isEnvDevelopment = env === 'development' - const isEnvProduction = env === 'production' - const isEnvTest = env === 'test' - const isTSEnable = process.env.AEGIR_TS === 'true' - const targets = { browsers: pkg.browserslist || browserslist } - if (!isEnvDevelopment && !isEnvProduction && !isEnvTest) { - throw new Error( - 'Using `babel-preset-env` requires that you specify `NODE_ENV` or ' + - '`BABEL_ENV` environment variables. Valid values are "development", ' + - '"test", and "production". Instead, received: ' + - JSON.stringify(env) + - '.' - ) - } - - return { - presets: [ - [ - require('@babel/preset-env').default, - { - corejs: 3, - useBuiltIns: 'entry', - modules: 'commonjs', - bugfixes: true, - targets - } - ], - isTSEnable && [ - '@babel/preset-typescript', - { - allowNamespaces: true - } - ] - ].filter(Boolean), - plugins: [ - '@babel/plugin-proposal-class-properties', - [ - require('@babel/plugin-transform-runtime').default, - { - helpers: false, - regenerator: true - } - ] - ] - } -} diff --git a/src/config/karma-entry.js b/src/config/karma-entry.js deleted file mode 100644 index 5525b5ae2..000000000 --- a/src/config/karma-entry.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' -/* eslint-disable */ -let testsContext -if (TS_ENABLED) { - testsContext = require.context(TEST_DIR, true, /\.spec\.ts$/) -} else { - testsContext = require.context(TEST_DIR, true, /\.spec\.js$/) -} - -if (TEST_BROWSER_JS) { - require(TEST_BROWSER_JS) -} -testsContext.keys().forEach(testsContext) diff --git a/src/config/karma.conf.js b/src/config/karma.conf.js deleted file mode 100644 index 2fe5ba5b1..000000000 --- a/src/config/karma.conf.js +++ /dev/null @@ -1,147 +0,0 @@ -'use strict' - -const merge = require('webpack-merge') -const webpack = require('webpack') -const path = require('path') -const webpackConfig = require('./webpack.config') -const { fromRoot, hasFile } = require('../utils') -const { userConfig } = require('./user') -const isTSEnable = process.env.AEGIR_TS === 'true' -const isWebworker = process.env.AEGIR_RUNNER === 'webworker' -const isProgressEnabled = process.env.AEGIR_PROGRESS === 'true' - -// Env to pass in the bundle with DefinePlugin -const env = { - TS_ENABLED: process.env.AEGIR_TS, - 'process.env': JSON.stringify(process.env), - TEST_DIR: JSON.stringify(fromRoot('test')), - TEST_BROWSER_JS: hasFile('test', isTSEnable ? 'browser.ts' : 'browser.js') - ? JSON.stringify(fromRoot('test', isTSEnable ? 'browser.ts' : 'browser.js')) - : JSON.stringify('') -} - -// Webpack overrides for karma -const karmaWebpackConfig = merge.strategy({ plugins: 'replace' })(webpackConfig(), { - entry: '', - plugins: [ - new webpack.DefinePlugin(env) - ], - module: { - rules: [ - { - oneOf: [ - { - test: /\.(js|ts)$/, - include: fromRoot('test'), - use: { - loader: require.resolve('babel-loader'), - options: { - presets: [require('./babelrc')()], - babelrc: false, - cacheDirectory: true - } - } - } - ] - } - ] - } -}) - -const karmaConfig = () => { - const files = JSON.parse(process.env.AEGIR_FILES) - const mocha = { - reporter: 'spec', - timeout: Number(process.env.AEGIR_MOCHA_TIMEOUT), - bail: process.env.AEGIR_MOCHA_BAIL === 'true', - grep: process.env.AEGIR_MOCHA_GREP - } - - const karmaEntry = path.join(__dirname, 'karma-entry.js') - - if (!files.length) { - // only try to load *.spec.js if we aren't specifying custom files - files.push(karmaEntry) - } - - return { - browsers: ['ChromeHeadlessNoSandbox'], - customLaunchers: { - ChromeHeadlessNoSandbox: { - base: 'ChromeHeadless', - flags: ['--no-sandbox'] - } - }, - frameworks: isWebworker ? ['mocha-webworker'] : ['mocha'], - basePath: process.cwd(), - files: files - .map(f => { - return { - pattern: f, - included: !isWebworker - } - }) - .concat([ - { - pattern: 'test/fixtures/**/*', - watched: false, - served: true, - included: false - } - ]), - - preprocessors: files.reduce((acc, f) => { - acc[f] = ['webpack', 'sourcemap'] - return acc - }, {}), - - client: { - mocha, - mochaWebWorker: { - pattern: [ - ...files, - 'karma-entry.js' - ], - mocha - } - }, - - webpack: karmaWebpackConfig, - - webpackMiddleware: { - stats: 'errors-only' - }, - - reporters: [ - isProgressEnabled && 'progress', - !isProgressEnabled && 'mocha' - ].filter(Boolean), - - mochaReporter: { - output: 'autowatch', - showDiff: true - }, - - plugins: [ - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-mocha', - 'karma-mocha-reporter', - 'karma-mocha-webworker', - 'karma-sourcemap-loader', - 'karma-webpack' - ], - - autoWatch: false, - singleRun: true, - colors: true, - browserNoActivityTimeout: 50 * 1000 - } -} - -/** - * @param {any} config - */ -module.exports = (config) => { - config.set(merge(karmaConfig(), userConfig.karma)) -} diff --git a/src/config/pw-test.js b/src/config/pw-test.js new file mode 100644 index 000000000..aba9c50c7 --- /dev/null +++ b/src/config/pw-test.js @@ -0,0 +1,4 @@ +'use strict' +const { userConfig } = require('./user') + +module.exports = userConfig.test.browser.config || {} diff --git a/src/config/register.js b/src/config/register.js deleted file mode 100644 index 9ca2a01fb..000000000 --- a/src/config/register.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' -const { fromAegir } = require('./../utils') - -require('@babel/register')({ - extensions: ['.ts'], - presets: [fromAegir('src/config/babelrc.js')] -}) diff --git a/src/config/user.js b/src/config/user.js index 84f31053b..11bae2d8d 100644 --- a/src/config/user.js +++ b/src/config/user.js @@ -3,38 +3,111 @@ const { lilconfigSync } = require('lilconfig') const merge = require('merge-options') -const utils = require('../utils') /** * @typedef {import("./../types").Options} Options */ -/** - * - * @param {*} hooks - */ -function normalizeHooks (hooks = {}) { - const result = { +/** @type {Omit} */ +const defaults = { + // global options + debug: false, + tsRepo: false, + // test cmd options + test: { + runner: 'node', + target: ['node', 'browser', 'webworker'], + watch: false, + files: [], + timeout: 5000, + grep: '', + bail: false, + progress: false, + cov: false, browser: { - pre: () => Promise.resolve(), - post: () => Promise.resolve() + config: {} }, - node: { - pre: () => Promise.resolve(), - post: () => Promise.resolve() - } - } - - if (hooks.pre && hooks.post) { - result.browser.pre = hooks.pre - result.browser.post = hooks.post - result.node.pre = hooks.pre - result.node.post = hooks.post - - return result + before: async () => { return undefined }, + after: async () => {} + }, + // build cmd options + build: { + bundle: true, + bundlesize: false, + bundlesizeMax: '100kB', + types: true, + config: {} + }, + // linter cmd options + lint: { + silent: false, + fix: false, + files: [ + '*.{js,ts}', + 'bin/**', + 'config/**/*.{js,ts}', + 'test/**/*.{js,ts}', + 'src/**/*.{js,ts}', + 'tasks/**/*.{js,ts}', + 'benchmarks/**/*.{js,ts}', + 'utils/**/*.{js,ts}', + '!**/node_modules/**', + '!**/*.d.ts' + ] + }, + // docs cmd options + docs: { + publish: false, + entryPoint: 'src/index.js' + }, + // ts cmd options + ts: { + preset: undefined, + include: [], + copyFrom: 'src/**/*.d.ts', + copyTo: 'dist' + }, + // release cmd options + release: { + build: true, + types: true, + test: true, + lint: true, + contributors: true, + bump: true, + changelog: true, + publish: true, + commit: true, + tag: true, + push: true, + ghrelease: true, + docs: true, + ghtoken: '', + type: 'patch', + preid: undefined, + distTag: 'latest', + remote: 'origin' + }, + // dependency check cmd options + dependencyCheck: { + input: [ + 'package.json', + '.aegir.js', + 'src/**/*.js', + 'test/**/*.js', + 'benchmarks/**/*.js', + 'utils/**/*.js', + '!./test/fixtures/**/*.js' + ], + productionOnly: false, + productionInput: [ + 'package.json', + 'src/**/*.js' + ], + ignore: [ + '@types/*' + ] } - - return merge(result, hooks) } /** @@ -64,59 +137,10 @@ const config = (searchFrom) => { throw new Error('Error finding your config file.') } - /** @type {Options} */ - const conf = merge( - { - // global options - debug: false, - node: false, - tsRepo: false, - // old options - webpack: {}, - karma: {}, - hooks: {}, - entry: utils.fromRoot('src', 'index.js'), - // build cmd options - build: { - bundle: true, - bundlesize: false, - bundlesizeMax: '100kB', - types: true - }, - // linter cmd options - lint: { - silent: false, - fix: false, - files: [ - '*.{js,ts}', - 'bin/**', - 'config/**/*.{js,ts}', - 'test/**/*.{js,ts}', - 'src/**/*.{js,ts}', - 'tasks/**/*.{js,ts}', - 'benchmarks/**/*.{js,ts}', - 'utils/**/*.{js,ts}', - '!**/node_modules/**', - '!**/*.d.ts' - ] - }, - // docs cmd options - docs: { - publish: false, - entryPoint: 'src/index.js' - }, - ts: { - preset: undefined, - include: [], - copyFrom: 'src/**/*.d.ts', - copyTo: 'dist' - } - }, - userConfig, - { - hooks: normalizeHooks(userConfig.hooks) - } - ) + const conf = /** @type {Options} */(merge( + defaults, + userConfig + )) return conf } diff --git a/src/config/webpack.config.js b/src/config/webpack.config.js deleted file mode 100644 index b8b725d47..000000000 --- a/src/config/webpack.config.js +++ /dev/null @@ -1,193 +0,0 @@ -'use strict' - -const path = require('path') -const pascalcase = require('pascalcase') -const webpack = require('webpack') -const merge = require('webpack-merge') -const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') -const TerserPlugin = require('terser-webpack-plugin') -const { fromRoot, pkg, paths } = require('../utils') -const { userConfig } = require('./user') -const isProduction = process.env.NODE_ENV === 'production' -const isTSEnable = process.env.AEGIR_TS === 'true' - -const base = (env, argv) => { - const filename = [ - 'index', - isProduction ? '.min' : null, - '.js' - ] - .filter(Boolean) - .join('') - - return { - bail: Boolean(isProduction), - mode: isProduction ? 'production' : 'development', - entry: [isTSEnable ? fromRoot('src', 'index.ts') : fromRoot('src', 'index.js')], - output: { - path: paths.dist, - filename: filename, - sourceMapFilename: filename + '.map', - library: pascalcase(pkg.name), - libraryTarget: 'umd', - globalObject: 'self', // Use `self` as `window` doesn't not exist within a Service/Web Worker context - devtoolModuleFilenameTemplate: info => 'file:' + encodeURI(info.absoluteResourcePath) - }, - module: { - rules: [ - { - oneOf: [ - { - test: /\.(js|ts)$/, - include: paths.src, - use: { - loader: require.resolve('babel-loader'), - options: { - presets: [require('./babelrc')()], - babelrc: false, - cacheDirectory: true - } - } - }, - { - test: /\.js$/, - exclude: /@babel(?:\/|\\{1,2})runtime/, - use: { - loader: require.resolve('babel-loader'), - options: { - presets: [require('./babelrc')()], - babelrc: false, - cacheDirectory: true, - sourceMaps: false - } - } - } - ] - } - ] - }, - resolve: { - extensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.d.ts'], - alias: { - '@babel/runtime': path.dirname( - require.resolve('@babel/runtime/package.json') - ) - } - }, - optimization: { - minimize: isProduction, - minimizer: [ - // This is only used in production mode - new TerserPlugin({ - terserOptions: { - parse: { - // we want terser to parse ecma 8 code. However, we don't want it - // to apply any minfication steps that turns valid ecma 5 code - // into invalid ecma 5 code. This is why the 'compress' and 'output' - // sections only apply transformations that are ecma 5 safe - // https://github.com/facebook/create-react-app/pull/4234 - ecma: 8 - }, - compress: { - ecma: 5, - warnings: false - }, - mangle: { - safari10: true - }, - output: { - ecma: 5, - comments: false - } - }, - // Use multi-process parallel running to improve the build speed - // Default number of concurrent runs: os.cpus().length - 1 - parallel: true, - // Enable file caching - cache: true, - sourceMap: true - }) - ] - }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env': JSON.stringify({ - DEBUG: process.env.DEBUG, - NODE_ENV: process.env.NODE_ENV - }) - }) - ], - target: 'web', - node: process.env.AEGIR_NODE === 'false' - ? { - global: true, - __filename: 'mock', - __dirname: 'mock', - dgram: false, - fs: false, - net: false, - tls: false, - child_process: false, - console: false, - // TODO remove this once readable-stream is fixed probably on in v4 - // https://github.com/nodejs/readable-stream/pull/435 - process: true, - Buffer: false, - setImmediate: false, - os: false, - assert: false, - constants: false, - events: false, - http: false, - path: false, - querystring: false, - stream: false, - string_decoder: false, - timers: false, - url: false, - util: false, - crypto: false - } - : { - dgram: 'empty', - fs: 'empty', - net: 'empty', - tls: 'empty', - child_process: 'empty', - console: false, - global: true, - process: true, - __filename: 'mock', - __dirname: 'mock', - Buffer: true, - setImmediate: true - }, - performance: { - hints: false - }, - stats: 'errors-warnings' - } -} - -module.exports = (env, argv) => { - const external = typeof userConfig.webpack === 'function' - ? userConfig.webpack(env, argv) - : userConfig.webpack - if (process.env.AEGIR_BUILD_ANALYZE === 'true') { - return merge( - base(env, argv), - { - plugins: [ - new BundleAnalyzerPlugin({ generateStatsFile: true, analyzerMode: 'static', logLevel: 'error', openAnalyzer: process.env.CI === undefined }) - ], - profile: true - }, - external - ) - } - - return merge( - base(env, argv), - external - ) -} diff --git a/src/dependency-check.js b/src/dependency-check.js index 32a98c5a3..37e7ffc3b 100644 --- a/src/dependency-check.js +++ b/src/dependency-check.js @@ -4,85 +4,39 @@ const path = require('path') const execa = require('execa') const merge = require('merge-options') -/** @typedef { import("execa").Options} ExecaOptions */ -/** @typedef { import("execa").ExecaChildProcess} ExecaChildProcess */ - -const defaultInput = [ - 'package.json', - '.aegir.js*', - './test/**/*.js', - './src/**/*.js', - '!./test/fixtures/**/*.js' -] - -const commandNames = ['dependency-check', 'dep-check', 'dep'] - /** - * Returns true if the user invoked the command with non-flag or - * optional args - * - * @param {Array} input - input files maybe passed by the user, maybe defaults - * @param {Array} processArgs - process.argv or similar - * @returns {boolean} + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import("./types").GlobalOptions} GlobalOptions + * @typedef {import("./types").DependencyCheckOptions} DependencyCheckOptions */ -const hasPassedFileArgs = (input, processArgs) => { - // if any of the passed paths are not in the process.argv used to invoke - // this command, we have been passed defaults and not user input - for (const path of input) { - if (!processArgs.includes(path)) { - return false - } - } - - return true -} +/** + * @param {any} arr1 + * @param {any} arr2 + */ +const isDefaultInput = (arr1, arr2) => + JSON.stringify(arr1) === JSON.stringify(arr2) /** * Check dependencies * - * @param {object} argv - Command line arguments passed to the process. - * @param {Array} processArgs - Unparsed command line arguments used to start the process - * @param {ExecaOptions} execaOptions - execa options. - * @returns {ExecaChildProcess} - Child process that does dependency check. + * @param {GlobalOptions & DependencyCheckOptions} argv - Command line arguments passed to the process. + * @param {ExecaOptions} [execaOptions] - execa options. */ -const check = (argv = { _: [], input: [], ignore: [] }, processArgs = [], execaOptions) => { +const check = (argv, execaOptions) => { const forwardOptions = argv['--'] ? argv['--'] : [] - let input = argv.input + const input = + argv.productionOnly && + isDefaultInput(argv.fileConfig.dependencyCheck.input, argv.input) + ? argv.fileConfig.dependencyCheck.productionInput + : argv.input + const noDev = argv.productionOnly ? ['--no-dev'] : [] const ignore = argv.ignore + .concat(argv.fileConfig.dependencyCheck.ignore) + .reduce((acc, i) => acc.concat('-i', i), /** @type {string[]} */ ([])) - if (argv.productionOnly) { - if (!hasPassedFileArgs(input, processArgs)) { - input = [ - 'package.json', - './src/**/*.js' - ] - } - - forwardOptions.push('--no-dev') - } - - if (ignore.length) { - // this allows us to specify ignores on a per-module basis while also orchestrating the command across multiple modules. - // - // e.g. npm script in package.json: - // "dependency-check": "aegir dependency-check -i cross-env", - // - // .travis.yml: - // lerna run dependency-check -- -p -- --unused - // - // results in the following being run in the package: - // aegir dependency-check -i cross-env -p -- --unused - ignore.forEach(i => { - forwardOptions.push('-i', i) - }) - } - - return execa('dependency-check', - [ - ...input, - '--missing', - ...forwardOptions - ], + return execa( + 'dependency-check', + [...input, '--missing', ...noDev, ...ignore, ...forwardOptions], merge( { localDir: path.join(__dirname, '..'), @@ -93,6 +47,6 @@ const check = (argv = { _: [], input: [], ignore: [] }, processArgs = [], execaO ) } -module.exports = check -module.exports.defaultInput = defaultInput -module.exports.commandNames = commandNames +module.exports = { + check +} diff --git a/src/docs/index.js b/src/docs/index.js index e8636b206..fd432db27 100644 --- a/src/docs/index.js +++ b/src/docs/index.js @@ -1,7 +1,7 @@ 'use strict' const Listr = require('listr') -const chalk = require('chalk') +const kleur = require('kleur') const execa = require('execa') const fs = require('fs-extra') const path = require('path') @@ -40,7 +40,7 @@ const docs = async (ctx, task) => { } if (!hasTsconfig) { // eslint-disable-next-line no-console - console.error(chalk.yellow('Documentation requires typescript config.\nTry running `aegir ts --preset config > tsconfig.json`')) + console.error(kleur.yellow('Documentation requires typescript config.\nTry running `aegir ts --preset config > tsconfig.json`')) return } // run typedoc @@ -60,8 +60,8 @@ const docs = async (ctx, task) => { preferLocal: true } ) - proc.stdout?.on('data', chunk => { - task.output = chunk.toString() + proc.all?.on('data', chunk => { + task.output = chunk.toString().replace('\n', '') }) await proc @@ -80,7 +80,7 @@ const publishDocs = () => { ) } -const TASKS = new Listr( +const tasks = new Listr( [ { title: 'Clean ./docs', @@ -88,6 +88,11 @@ const TASKS = new Listr( }, { title: 'Generating documentation', + /** + * + * @param {GlobalOptions & DocsOptions} ctx + * @param {Task} task + */ task: docs }, { @@ -97,8 +102,8 @@ const TASKS = new Listr( } ], { - renderer: 'default' + renderer: 'verbose' } ) -module.exports = TASKS +module.exports = tasks diff --git a/src/fixtures.browser.js b/src/fixtures.browser.js deleted file mode 100644 index e2ba305dd..000000000 --- a/src/fixtures.browser.js +++ /dev/null @@ -1,35 +0,0 @@ -/* global self */ -'use strict' - -const { Buffer } = require('buffer') -// note: filePath needs to be relative to the module root -module.exports = function loadFixtures (filePath, module) { - if (module) { - filePath = 'node_modules/' + module + '/' + filePath - } - return syncXhr(filePath) -} - -// @dignifiedquire: I know this is considered bad practice (syncXhr), but it -// makes testing life so much nicer! -function syncXhr (filePath) { - const target = '/base/' + filePath - - const request = new self.XMLHttpRequest() - request.open('GET', target, false) - request.overrideMimeType('text/plain; charset=x-user-defined') - request.send(null) - - if (request.status === 200) { - const filestream = request.responseText - const res = new Uint8Array(filestream.length) - - for (let i = 0; i < filestream.length; i++) { - res[i] = filestream.charCodeAt(i) & 0xff - } - - return Buffer.from(res) - } else { - throw new Error(`Could not get the Fixture: ${filePath}`) - } -} diff --git a/src/fixtures.js b/src/fixtures.js deleted file mode 100644 index 3a73929a5..000000000 --- a/src/fixtures.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict' - -const path = require('path') - -// note: filePath needs to be relative to the module root -module.exports = function loadFixtures (filePath, module) { - if (module) { - filePath = path.join(module, filePath) - } - - const fs = require('fs') - const paths = [ - path.join(process.cwd(), filePath), - path.join(process.cwd(), 'node_modules', filePath), - resolve(filePath) - ] - - const resourcePath = paths.find(path => fs.existsSync(path)) - - if (!resourcePath) { - throw new Error(`Could not load ${filePath}`) - } - - return fs.readFileSync(resourcePath) -} - -function resolve (filePath) { - try { - return require.resolve(filePath) - } catch (error) { - // ignore error - } -} diff --git a/src/index.js b/src/index.js index c618df5ec..dcfa4d5e2 100644 --- a/src/index.js +++ b/src/index.js @@ -1,2 +1,9 @@ /* eslint-disable no-console */ 'use strict' + +/** + * @typedef {import('./types').Options} Options + * @typedef {import('./types').PartialOptions} PartialOptions + */ + +module.exports = {} diff --git a/src/lint.js b/src/lint.js index 8d125902d..2c59076eb 100644 --- a/src/lint.js +++ b/src/lint.js @@ -3,34 +3,51 @@ const globby = require('globby') const { ESLint } = require('eslint') +const Listr = require('listr') /** * @typedef {import("./types").GlobalOptions} GlobalOptions * @typedef {import("./types").LintOptions} LintOptions + * @typedef {import("listr").ListrTaskWrapper} Task * */ -/** - * - * @param {GlobalOptions & LintOptions} opts - */ -async function runLinter (opts) { - const eslint = new ESLint({ - fix: opts.fix, - baseConfig: { extends: 'ipfs' }, - useEslintrc: true - }) - const results = await eslint.lintFiles(await globby(opts.files)) - const formatter = await eslint.loadFormatter('unix') - if (opts.fix) { - await ESLint.outputFixes(results) - } - if (!opts.silent) { - console.log(formatter.format(results)) - } - if (ESLint.getErrorResults(results).length > 0) { - throw new Error('Lint errors') +const tasks = new Listr( + [ + { + title: 'Lint files', + /** + * + * @param {GlobalOptions & LintOptions} ctx + * @param {Task} task + */ + task: async (ctx, task) => { + const eslint = new ESLint({ + fix: ctx.fix, + baseConfig: { extends: 'ipfs' }, + useEslintrc: true + }) + const results = await eslint.lintFiles(await globby(ctx.files)) + const formatter = await eslint.loadFormatter('unix') + const hasErrors = ESLint.getErrorResults(results).length > 0 + + if (ctx.fix) { + await ESLint.outputFixes(results) + } + + if (!ctx.silent && hasErrors) { + console.error(formatter.format(results)) + } + + if (hasErrors) { + throw new Error('Lint errors') + } + } + } + ], + { + renderer: 'verbose' } -} +) -module.exports = runLinter +module.exports = tasks diff --git a/src/publish-rc/index.js b/src/publish-rc/index.js deleted file mode 100644 index 88b895d2d..000000000 --- a/src/publish-rc/index.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict' - -const { - exec -} = require('../utils') -const path = require('path') -const release = require('../release') -const semver = require('semver') - -async function publishRc (opts) { - try { - console.info(`Removing local copy of ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['branch', '-D', opts.branch]) - } catch (err) { - if (!err.message.includes(`branch '${opts.branch}' not found`)) { - throw err - } - } - - console.info('Fetching repo history') // eslint-disable-line no-console - await exec('git', ['fetch']) - - console.info(`Checking out branch ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['checkout', '--track', `${opts.remote}/${opts.branch}`]) - - console.info('Removing dependencies') // eslint-disable-line no-console - await exec('rm', ['-rf', 'node_modules', 'package-lock.json']) - - console.info('Installing dependencies') // eslint-disable-line no-console - await exec('npm', ['ci']) - - console.info('Reading version number') // eslint-disable-line no-console - const pkg = require(path.join(process.cwd(), 'package.json')) - - console.info('Found version number', pkg.version) // eslint-disable-line no-console - const version = pkg.version - const newVersion = semver.inc(version, opts.type) - const newVersionBranch = `${opts.prefix}v${newVersion.split('.').filter((sub, i) => { - return i < 2 - }).join('.')}.x` - console.info('Creating release branch', newVersionBranch) // eslint-disable-line no-console - - await exec('git', ['checkout', '-b', newVersionBranch]) - await exec('git', ['push', opts.remote, `${newVersionBranch}:${newVersionBranch}`], { - quiet: true - }) - - if (version.includes('-')) { - // already a pre${opts.type}, change from prepatch, preminor, etc to 'prerelease' - // e.g. 0.38.0-pre.1 -> 0.38.0-rc.0 - opts.type = 'release' - } - - console.info('Creating', opts.preId) // eslint-disable-line no-console - await release({ - type: `pre${opts.type}`, - preid: opts.preId, - 'dist-tag': opts.distTag, - build: false, - test: false, - lint: false, - docsFormats: ['html'], - contributors: true, - bump: true, - changelog: true, - publish: true, - ghrelease: true, - docs: true, - ghtoken: opts.ghtoken || process.env.AEGIR_GHTOKEN, - remote: opts.remote - }) -} - -module.exports = publishRc diff --git a/src/release/bump.js b/src/release/bump.js index 3a5a3ab7f..e257d2391 100644 --- a/src/release/bump.js +++ b/src/release/bump.js @@ -6,8 +6,13 @@ const fs = require('fs-extra') const { paths } = require('../utils') /** - * @param {{ type: any; preid: any; }} ctx - * @param {{ title: string; }} task + * @typedef {import('./../types').ReleaseOptions} ReleaseOptions + * @typedef {import('listr').ListrTaskWrapper} ListrTask + */ + +/** + * @param {{ type: ReleaseOptions["type"]; preid: ReleaseOptions["preid"]; }} ctx + * @param {ListrTask} task */ function bump (ctx, task) { const { type, preid } = ctx @@ -16,7 +21,6 @@ function bump (ctx, task) { .then((pkg) => { const version = pkg.version const newVersion = semver.inc(version, type, preid) - task.title += `: v${version} -> v${newVersion}` pkg.version = newVersion diff --git a/src/release/changelog.js b/src/release/changelog.js index e98b9dc15..a0f8ae2a8 100644 --- a/src/release/changelog.js +++ b/src/release/changelog.js @@ -4,11 +4,22 @@ const conventionalChangelog = require('conventional-changelog') const fs = require('fs-extra') const path = require('path') +/** + * @typedef {import('./../types').ReleaseOptions} ReleaseOptions + * @typedef {import('listr').ListrTaskWrapper} ListrTask + */ + +/** + * + * @param {*} ctx + * @param {ListrTask} task + */ function changelog (ctx, task) { const changelogPath = path.join(process.cwd(), 'CHANGELOG.md') const releaseCount = fs.existsSync(changelogPath) ? 1 : 0 + /** @type {Buffer} */ let current if (releaseCount === 0) { diff --git a/src/release/commit.js b/src/release/commit.js index 8ef292dd4..fa421e8e8 100644 --- a/src/release/commit.js +++ b/src/release/commit.js @@ -1,11 +1,12 @@ 'use strict' const git = require('simple-git/promise')(process.cwd()) -const { pkg } = require('../utils') +const { readJson, paths } = require('../utils') const files = ['package.json', 'CHANGELOG.md'] async function commit () { + const pkg = readJson(paths.package) await git.add(files) await git.commit( diff --git a/src/release/contributors.js b/src/release/contributors.js index 771e2c912..da9d1cef2 100644 --- a/src/release/contributors.js +++ b/src/release/contributors.js @@ -2,10 +2,13 @@ const git = require('simple-git/promise')(process.cwd()) const execa = require('execa') -const { paths } = require('../utils') +const { paths, fromAegir } = require('../utils') const contributors = async () => { - await execa('git-authors-cli', ['--print', 'false']) + await execa('git-authors-cli', ['--print', 'false'], { + localDir: fromAegir(), + preferLocal: true + }) const res = await git.status() diff --git a/src/release/github.js b/src/release/github.js index 6ef432721..f6aabb3a1 100644 --- a/src/release/github.js +++ b/src/release/github.js @@ -1,8 +1,15 @@ 'use strict' +// @ts-ignore const conventionalGithubReleaser = require('conventional-github-releaser') const { promisify } = require('util') +/** + * Github release + * + * @param {{ ghtoken: string; }} opts + * @returns {Promise} + */ function github (opts) { return promisify(conventionalGithubReleaser)({ type: 'oauth', diff --git a/src/release/index.js b/src/release/index.js index 242acf2fc..282117280 100644 --- a/src/release/index.js +++ b/src/release/index.js @@ -4,10 +4,9 @@ const Listr = require('listr') const lint = require('../lint') const test = require('../test') +const ts = require('../ts') const build = require('../build') -const utils = require('../utils') const docs = require('../docs') - const releaseChecks = require('./prerelease') const bump = require('./bump') const changelog = require('./changelog') @@ -18,71 +17,133 @@ const github = require('./github') const publish = require('./publish') const push = require('./push') -function release (opts) { - const tasks = new Listr([ - { - title: 'Lint', - task: (ctx) => lint({ ...ctx, silent: true }), - enabled: (ctx) => ctx.lint - }, - { - title: 'Test', - task: (ctx) => test.run({ ...ctx, progress: true }), - enabled: (ctx) => ctx.test - }, - { - title: 'Bump Version', - task: bump, - enabled: (ctx) => ctx.bump - }, - { - title: 'Build', - task: (ctx) => build(ctx), - enabled: (ctx) => ctx.build - }, - { - title: 'Update Contributors', - task: contributors, - enabled: (ctx) => ctx.contributors - }, - { - title: 'Generate Changelog', - task: changelog, - enabled: (ctx) => ctx.changelog - }, - { - title: 'Commit to Git', - task: commit, - enabled: (ctx) => ctx.commit - }, - { - title: 'Tag release', - task: tag, - enabled: (ctx) => ctx.tag - }, - { - title: 'Push to GitHub', - task: push, - enabled: (ctx) => ctx.push - }, - { - title: 'Generate GitHub Release', - task: github, - enabled: (ctx) => ctx.ghrelease - }, - { - title: 'Publish documentation', - task: () => docs, - enabled: (ctx) => ctx.docs - }, +/** + * @typedef {import('./../types').ReleaseOptions} ReleaseOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ + +/** + * Release command + * + * @param {GlobalOptions & ReleaseOptions} opts + */ +async function release (opts) { + const globalOptions = { + debug: opts.debug, + tsRepo: opts.tsRepo, + fileConfig: opts.fileConfig + } + + const tasks = new Listr( + [ + { + title: 'Lint', + task: () => { + lint.setRenderer('silent') + return lint.run({ + ...globalOptions, + ...opts.fileConfig.lint + }) + }, + enabled: () => opts.lint + }, + { + title: 'Types', + task: () => { + return ts({ + ...globalOptions, + ...opts.fileConfig.ts, + preset: 'check' + }) + }, + enabled: () => opts.types + }, + { + title: 'Test', + task: () => + test.run( + { + ...globalOptions, + ...opts.fileConfig.test + }, + { + stdio: 'ignore' + } + ), + enabled: (ctx) => ctx.test + }, + { + title: 'Bump Version', + task: (ctx, task) => + bump({ type: opts.type, preid: opts.preid }, task), + enabled: (ctx) => ctx.bump + }, + { + title: 'Build', + enabled: (ctx) => ctx.build, + task: () => { + build.setRenderer('silent') + return build.run({ + ...globalOptions, + ...opts.fileConfig.build + }) + } + }, + { + title: 'Update Contributors', + task: contributors, + enabled: (ctx) => ctx.contributors + }, + { + title: 'Generate Changelog', + task: changelog, + enabled: (ctx) => ctx.changelog + }, + { + title: 'Commit to Git', + task: commit, + enabled: (ctx) => ctx.commit + }, + { + title: 'Tag release', + task: tag, + enabled: (ctx) => ctx.tag + }, + { + title: 'Push to GitHub', + task: push, + enabled: (ctx) => ctx.push + }, + { + title: 'Generate GitHub Release', + task: () => github({ ghtoken: opts.ghtoken }), + enabled: (ctx) => ctx.ghrelease + }, + { + title: 'Documentation', + task: () => { + docs.setRenderer('silent') + return docs.run({ + ...globalOptions, + ...opts.fileConfig.docs, + publish: true + }) + }, + enabled: () => opts.docs + }, + { + title: 'Publish to npm', + task: (ctx, task) => publish(opts, task), + enabled: (ctx) => ctx.publish + } + ], { - title: 'Publish to npm', - task: publish, - enabled: (ctx) => ctx.publish + renderer: 'verbose' } - ], utils.getListrConfig()) + ) - return releaseChecks(opts).then(() => tasks.run(opts)) + await releaseChecks(opts) + return tasks.run(opts) } module.exports = release diff --git a/src/release/prerelease.js b/src/release/prerelease.js index 54b9dc64c..d3a49f4fb 100644 --- a/src/release/prerelease.js +++ b/src/release/prerelease.js @@ -2,17 +2,15 @@ const execa = require('execa') -// Check if there are valid GitHub credentials for publishing this module -function validGh (opts) { - if (!opts.ghrelease) { - return Promise.resolve(true) +/** + * Check if there are valid GitHub credentials for publishing this module + * + * @param {{ ghrelease: boolean; ghtoken: string; }} opts + */ +async function validGh (opts) { + if (opts.ghrelease && !opts.ghtoken) { + throw new Error('Missing GitHub access token. Have you set `AEGIR_GHTOKEN`?') } - - if (!opts.ghtoken) { - return Promise.reject(new Error('Missing GitHub access token. ' + - 'Have you set `AEGIR_GHTOKEN`?')) - } - return Promise.resolve() } // Is the current git workspace dirty? @@ -24,14 +22,20 @@ async function isDirty () { } } -// Validate that all requirements are met before starting the release -// - No dirty git -// - github token for github release, if github release is enabled +/** + * Validate that all requirements are met before starting the release + * - No dirty git + * - github token for github release, if github release is enabled + * + * @param {{ ghrelease: boolean; ghtoken: string; }} opts + */ function prerelease (opts) { - return Promise.all([ - isDirty(), - validGh(opts) - ]) + return Promise.all( + [ + isDirty(), + validGh(opts) + ] + ) } module.exports = prerelease diff --git a/src/release/publish.js b/src/release/publish.js index 67eba34d8..90f22198b 100644 --- a/src/release/publish.js +++ b/src/release/publish.js @@ -1,14 +1,22 @@ 'use strict' const execa = require('execa') -const prompt = require('prompt-promise') +const { otp } = require('../utils') +/** + * @typedef {import('./../types').ReleaseOptions} ReleaseOptions + * @typedef {import('listr').ListrTaskWrapper} ListrTask + */ +/** + * @param {{ distTag: ReleaseOptions["distTag"], type: ReleaseOptions["type"] }} ctx + * @param {ListrTask} task + */ function publish (ctx, task) { let publishArgs = ['publish'] - let distTag = ctx['dist-tag'] + let distTag = ctx.distTag // Prevent accidental publish of prerelease to "latest" - if (ctx.type.startsWith('pre') && !distTag) { + if (ctx.type.startsWith('pre') && distTag === 'latest') { distTag = 'next' } @@ -18,10 +26,11 @@ function publish (ctx, task) { } return execa('npm', publishArgs) - .catch(error => { + .catch(async (error) => { if (error.toString().includes('provide a one-time password')) { - return prompt.password('Enter an npm OTP: ') - .then(otp => execa('npm', publishArgs.concat('--otp', otp.trim()))) + const code = await otp() + task.title += '. Trying again with OTP.' + return await execa('npm', publishArgs.concat('--otp', code)) } throw error diff --git a/src/release/push.js b/src/release/push.js index af776645f..6195e50a7 100644 --- a/src/release/push.js +++ b/src/release/push.js @@ -3,18 +3,20 @@ const git = require('simple-git/promise')(process.cwd()) const execa = require('execa') +/** + * @param {{ remote: string; }} opts + */ async function push (opts) { - const remote = opts.remote || 'origin' const branch = (await execa('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: process.cwd() })).stdout return git.push( - remote, + opts.remote, branch, { // Linter and tests were already run by previous steps - '--no-verify': true, - '--tags': true + '--no-verify': null, + '--tags': null } ) } diff --git a/src/release/tag.js b/src/release/tag.js index ff8086735..2c495200c 100644 --- a/src/release/tag.js +++ b/src/release/tag.js @@ -2,9 +2,10 @@ const git = require('simple-git/promise')(process.cwd()) -const { pkg } = require('../utils') +const { paths, readJson } = require('../utils') async function tag () { + const pkg = readJson(paths.package) await git.addTag(`v${pkg.version}`) } diff --git a/src/test-dependant/index.js b/src/test-dependant/index.js index e7b37744b..fb9dcb8e8 100644 --- a/src/test-dependant/index.js +++ b/src/test-dependant/index.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ 'use strict' const path = require('path') @@ -8,47 +9,78 @@ const { const fs = require('fs-extra') const glob = require('it-glob') +/** + * @param {string} name + * @param {{ dependencies: any; }} pkg + */ const isDep = (name, pkg) => { return Object.keys(pkg.dependencies || {}).filter(dep => dep === name).pop() } +/** + * @param {string} name + * @param {{ devDependencies: any; }} pkg + */ const isDevDep = (name, pkg) => { return Object.keys(pkg.devDependencies || {}).filter(dep => dep === name).pop() } +/** + * @param {string} name + * @param {{ optionalDendencies: any; }} pkg + */ const isOptionalDep = (name, pkg) => { return Object.keys(pkg.optionalDendencies || {}).filter(dep => dep === name).pop() } +/** + * @param {string} name + * @param {any} pkg + */ const dependsOn = (name, pkg) => { return isDep(name, pkg) || isDevDep(name, pkg) || isOptionalDep(name, pkg) } +/** + * @param {string} targetDir + */ const isMonoRepo = (targetDir) => { return fs.existsSync(path.join(targetDir, 'lerna.json')) } +/** + * @param {string} targetDir + */ const hasNpmLock = (targetDir) => { return fs.existsSync(path.join(targetDir, 'package-lock.json')) || fs.existsSync(path.join(targetDir, 'npm-shrinkwrap.json')) } +/** + * @param {string} targetDir + */ const hasYarnLock = (targetDir) => { return fs.existsSync(path.join(targetDir, 'yarn.lock')) } +/** + * @param {string} message + */ const printFailureMessage = (message) => { - console.info('-------------------------------------------------------------------') // eslint-disable-line no-console - console.info('') // eslint-disable-line no-console - console.info(message) // eslint-disable-line no-console - console.info('') // eslint-disable-line no-console - console.info('Dependant project has not been tested with updated dependencies') // eslint-disable-line no-console - console.info('') // eslint-disable-line no-console - console.info('-------------------------------------------------------------------') // eslint-disable-line no-console + console.info('-------------------------------------------------------------------') + console.info('') + console.info(message) + console.info('') + console.info('Dependant project has not been tested with updated dependencies') + console.info('') + console.info('-------------------------------------------------------------------') } +/** + * @param {string} targetDir + */ const installDependencies = async (targetDir) => { - console.info('Installing dependencies') // eslint-disable-line no-console + console.info('Installing dependencies') if (hasYarnLock(targetDir)) { await exec('yarn', ['install'], { cwd: targetDir @@ -64,6 +96,10 @@ const installDependencies = async (targetDir) => { } } +/** + * @param {string} targetDir + * @param {{ [x: string]: any; }} deps + */ const upgradeDependenciesInDir = async (targetDir, deps) => { const modulePkgPath = path.join(targetDir, 'package.json') const modulePkg = require(modulePkgPath) @@ -73,11 +109,11 @@ const upgradeDependenciesInDir = async (targetDir, deps) => { modulePkg.optionalDependencies = modulePkg.optionalDependencies || {} modulePkg.devDependencies = modulePkg.devDependencies || {} - console.info('Upgrading deps') // eslint-disable-line no-console + console.info('Upgrading deps') for (const dep of Object.keys(deps)) { const existingVersion = modulePkg.dependencies[dep] || modulePkg.peerDependencies[dep] || modulePkg.optionalDependencies[dep] || modulePkg.devDependencies[dep] - console.info('Upgrading', dep, 'from version', existingVersion, 'to', deps[dep]) // eslint-disable-line no-console + console.info('Upgrading', dep, 'from version', existingVersion, 'to', deps[dep]) if (modulePkg.dependencies[dep] || modulePkg.peerDependencies[dep] || modulePkg.optionalDependencies[dep]) { modulePkg.dependencies[dep] = deps[dep] @@ -93,6 +129,10 @@ const upgradeDependenciesInDir = async (targetDir, deps) => { }) } +/** + * @param {string} targetDir + * @param {{}} deps + */ const testModule = async (targetDir, deps) => { const pkgPath = path.join(targetDir, 'package.json') @@ -124,7 +164,7 @@ const testModule = async (targetDir, deps) => { cwd: targetDir }) } catch (err) { - printFailureMessage(`Failed to run the tests of ${modulePkg.name}, aborting`, err.message) + printFailureMessage(`Failed to run the tests of ${modulePkg.name}, aborting ${err.message}`) return } @@ -138,11 +178,19 @@ const testModule = async (targetDir, deps) => { }) } +/** + * @param {string} targetDir + * @param {any} deps + */ const testRepo = async (targetDir, deps) => { await installDependencies(targetDir) await testModule(targetDir, deps) } +/** + * @param {string} targetDir + * @param {any} deps + */ const testMonoRepo = async (targetDir, deps) => { await installDependencies(targetDir) @@ -178,10 +226,13 @@ const testMonoRepo = async (targetDir, deps) => { } } +/** + * @param {{ repo: string; branch: string; deps: any; }} opts + */ async function testDependant (opts) { const targetDir = path.join(os.tmpdir(), `test-dependant-${Date.now()}`) - console.info(`Cloning ${opts.repo} into ${targetDir}`) // eslint-disable-line no-console + console.info(`Cloning ${opts.repo} into ${targetDir}`) await exec('git', ['clone', opts.repo, targetDir], { quiet: true }) @@ -198,7 +249,7 @@ async function testDependant (opts) { await testRepo(targetDir, opts.deps) } - console.info(`Removing ${targetDir}`) // eslint-disable-line no-console + console.info(`Removing ${targetDir}`) await fs.remove(targetDir) } diff --git a/src/test/browser.js b/src/test/browser.js index 04f50fbc2..f264148f7 100644 --- a/src/test/browser.js +++ b/src/test/browser.js @@ -1,52 +1,66 @@ 'use strict' const path = require('path') const execa = require('execa') -const { hook, fromAegir } = require('../utils') +const { fromAegir } = require('../utils') const merge = require('merge-options') -/** @typedef { import("execa").Options} ExecaOptions */ +/** + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import('./../types').TestOptions} TestOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ -module.exports = (argv, execaOptions) => { - const input = argv._.slice(1) - const forwardOptions = argv['--'] ? argv['--'] : [] - const watch = argv.watch ? ['--auto-watch', '--no-single-run'] : [] - const verbose = argv.verbose ? ['--log-level', 'debug'] : ['--log-level', 'error'] - const colors = argv.colors ? ['--colors'] : [] +/** + * + * @param {TestOptions & GlobalOptions} argv + * @param {ExecaOptions} execaOptions + */ +module.exports = async (argv, execaOptions) => { + const extra = argv['--'] ? argv['--'] : [] + const forwardOptions = /** @type {string[]} */([ + ...extra, + argv.timeout && `--timeout=${argv.timeout}`, + argv.grep && `--grep=${argv.grep}`, + argv.bail && '--bail' + ].filter(Boolean)) + const watch = argv.watch ? ['--watch'] : [] + const cov = argv.cov ? ['--cov'] : [] + const files = argv.files.length > 0 + ? argv.files + : [ + '**/*.spec.{js,ts}', + 'test/browser.{js,ts}' + ] - return hook('browser', 'pre')(argv.userConfig) - .then((hook = {}) => { - return execa('karma', - [ - 'start', - fromAegir('src/config/karma.conf.js'), - ...colors, - ...watch, - ...verbose, - ...input, - ...forwardOptions - ], - merge( - { - env: { - NODE_ENV: process.env.NODE_ENV || 'test', - AEGIR_RUNNER: argv.webworker ? 'webworker' : 'browser', - AEGIR_NODE: argv.node, - AEGIR_TS: argv.tsRepo, - AEGIR_MOCHA_TIMEOUT: argv.timeout ? `${argv.timeout}` : '5000', - AEGIR_MOCHA_GREP: argv.grep, - AEGIR_MOCHA_BAIL: argv.bail ? 'true' : 'false', - AEGIR_PROGRESS: argv.progress ? 'true' : 'false', - AEGIR_FILES: JSON.stringify(argv.files), - IS_WEBPACK_BUILD: true, - ...hook.env - }, - preferLocal: true, - localDir: path.join(__dirname, '../..'), - stdio: 'inherit' - }, - execaOptions - ) - ) - }) - .then(() => hook('browser', 'post')(argv.userConfig)) + // before hook + const before = await argv.fileConfig.test.before(argv) + const beforeEnv = before && before.env ? before.env : {} + + // run pw-test + await execa('pw-test', + [ + ...files, + '--mode', argv.runner === 'browser' ? 'main' : 'worker', + ...watch, + ...cov, + '--config', fromAegir('src/config/pw-test.js'), + ...forwardOptions + ], + merge( + { + env: { + AEGIR_RUNNER: argv.runner, + NODE_ENV: process.env.NODE_ENV || 'test', + ...beforeEnv + }, + preferLocal: true, + localDir: path.join(__dirname, '../..'), + stdio: 'inherit' + }, + execaOptions + ) + ) + + // after hook + await argv.fileConfig.test.after(argv, before) } diff --git a/src/test/electron.js b/src/test/electron.js index 0c6a3483c..3ecbd4f16 100644 --- a/src/test/electron.js +++ b/src/test/electron.js @@ -1,52 +1,62 @@ 'use strict' const path = require('path') const execa = require('execa') -const { hook, getElectron, fromAegir } = require('../utils') +const { getElectron } = require('../utils') +const merge = require('merge-options') -module.exports = (argv) => { - const input = argv._.slice(1) +/** + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import('./../types').TestOptions} TestOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ +/** + * + * @param {TestOptions & GlobalOptions} argv + * @param {ExecaOptions} execaOptions + */ +module.exports = async (argv, execaOptions) => { const forwardOptions = argv['--'] ? argv['--'] : [] const watch = argv.watch ? ['--watch'] : [] - const files = argv.files.length ? [...argv.files] : ['test/**/*.spec.{js,ts}'] - const verbose = argv.verbose ? ['--log-level', 'debug'] : ['--log-level', 'error'] + const files = argv.files.length > 0 ? [...argv.files] : ['test/**/*.spec.{js,ts}'] const grep = argv.grep ? ['--grep', argv.grep] : [] - const invert = argv.invert ? ['--invert'] : [] const progress = argv.progress ? ['--reporter=progress'] : [] - const bail = argv.bail ? ['--bail', argv.bail] : [] - const timeout = argv.timeout ? ['--timeout', argv.timeout] : [] - const renderer = argv.renderer ? ['--renderer'] : [] - const ts = argv.tsRepo ? ['--require', fromAegir('src/config/register.js')] : [] + const bail = argv.bail ? ['--bail'] : [] + const timeout = argv.timeout ? [`--timeout=${argv.timeout}`] : [] + const renderer = argv.runner === 'electron-renderer' ? ['--renderer'] : [] + const ts = argv.tsRepo ? ['--require', require.resolve('esbuild-register')] : [] - return hook('browser', 'pre')(argv.userConfig) - .then((hook = {}) => Promise.all([hook, getElectron()])) - .then(([hook, electronPath]) => { - return execa('electron-mocha', [ - ...input, - ...files, - ...watch, - ...verbose, - ...grep, - ...invert, - ...progress, - ...bail, - ...timeout, - ...ts, - ['--colors'], - ['--full-trace'], - ...renderer, - ...forwardOptions - ], { - localDir: path.join(__dirname, '../..'), - preferLocal: true, - stdio: 'inherit', - env: { - NODE_ENV: process.env.NODE_ENV || 'test', - AEGIR_RUNNER: argv.renderer ? 'electron-renderer' : 'electron-main', - ELECTRON_PATH: electronPath, - AEGIR_TS: argv.tsRepo, - ...hook.env - } - }) - }) - .then(() => hook('browser', 'post')(argv.userConfig)) + // before hook + const before = await argv.fileConfig.test.before(argv) + const beforeEnv = before && before.env ? before.env : {} + const electronPath = await getElectron() + + await execa('electron-mocha', + [ + ...files, + ...watch, + ...grep, + ...progress, + ...bail, + ...timeout, + ...ts, + '--colors', + '--full-trace', + ...renderer, + ...forwardOptions + ], + merge({ + localDir: path.join(__dirname, '../..'), + preferLocal: true, + stdio: 'inherit', + env: { + AEGIR_RUNNER: argv.runner, + NODE_ENV: process.env.NODE_ENV || 'test', + ELECTRON_PATH: electronPath, + ...beforeEnv + } + }, + execaOptions) + ) + // after hook + await argv.fileConfig.test.after(argv, before) } diff --git a/src/test/index.js b/src/test/index.js index 0667b6383..a6d7b3966 100644 --- a/src/test/index.js +++ b/src/test/index.js @@ -1,48 +1,94 @@ 'use strict' +const pmap = require('p-map') +const node = require('./node') +const browser = require('./browser') +const electron = require('./electron') + +/** + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import('./../types').TestOptions} TestOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ + const TASKS = [ { title: 'Test Node.js', - task: (opts, execaOptions) => require('./node')(opts, execaOptions), + /** + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + task: (opts, execaOptions) => node({ ...opts, runner: 'node' }, execaOptions), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('node') }, { title: 'Test Browser', - task: require('./browser'), + /** + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + task: (opts, execaOptions) => browser({ ...opts, runner: 'browser' }, execaOptions), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('browser') }, { title: 'Test Webworker', - task: (opts, execaOptions) => require('./browser')(Object.assign(opts, { webworker: true }), execaOptions), + /** + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + task: (opts, execaOptions) => browser({ ...opts, runner: 'webworker' }, execaOptions), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('webworker') }, { title: 'Test Electron Main', - task: (opts) => require('./electron')(Object.assign(opts, { renderer: false })), + /** + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + task: (opts, execaOptions) => electron({ ...opts, runner: 'electron-main' }, execaOptions), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('electron-main') }, { title: 'Test Electron Renderer', - task: (opts) => require('./electron')(Object.assign(opts, { renderer: true })), + /** + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + task: (opts, execaOptions) => electron({ ...opts, runner: 'electron-renderer' }, execaOptions), + /** + * @param {TestOptions & GlobalOptions} ctx + */ enabled: (ctx) => ctx.target.includes('electron-renderer') } ] module.exports = { - run (opts, execaOptions) { - const { userConfig } = require('../config/user') - const pmap = require('p-map') - - // TODO remove hooks and just use opts.userConfig - opts.hooks = userConfig.hooks - opts.userConfig = userConfig + /** + * + * @param {TestOptions & GlobalOptions} opts + * @param {ExecaOptions} execaOptions + */ + run (opts, execaOptions = {}) { return pmap(TASKS, (task) => { if (!task.enabled(opts)) { return Promise.resolve() } - - console.log(task.title) // eslint-disable-line no-console + if (execaOptions.stdio !== 'ignore') { + console.log(task.title) // eslint-disable-line no-console + } return task.task(opts, execaOptions) }, { concurrency: 1 }) } diff --git a/src/test/node.js b/src/test/node.js index 8a2b75d1d..5e75282f8 100644 --- a/src/test/node.js +++ b/src/test/node.js @@ -2,105 +2,89 @@ const execa = require('execa') const path = require('path') -const { hook, fromAegir } = require('../utils') +const tempy = require('tempy') const merge = require('merge-options') -const DEFAULT_TIMEOUT = global.DEFAULT_TIMEOUT || 5 * 1000 - -/** @typedef { import("execa").Options} ExecaOptions */ - -function testNode (argv, execaOptions) { - let exec = 'mocha' - const env = { - NODE_ENV: 'test', - AEGIR_RUNNER: 'node', - AEGIR_TS: argv.tsRepo - } - const timeout = argv.timeout || DEFAULT_TIMEOUT - - let args = [ - argv.progress && '--reporter=progress', +/** + * @typedef {import("execa").Options} ExecaOptions + * @typedef {import('./../types').TestOptions} TestOptions + * @typedef {import('./../types').GlobalOptions} GlobalOptions + */ + +/** + * + * @param {TestOptions & GlobalOptions} argv + * @param {ExecaOptions} execaOptions + */ +async function testNode (argv, execaOptions) { + const exec = argv.cov ? 'c8' : 'mocha' + const progress = argv.progress ? ['--reporter=progress'] : [] + const covArgs = argv.cov + ? [ + '--reporter', 'json', + '--report-dir', '.nyc_output', + '--temp-directory', tempy.directory(), + '--clean', + 'mocha' + ] + : [] + const files = argv.files.length > 0 + ? argv.files + : [ + 'test/node.{js,ts}', + 'test/**/*.spec.{js,ts}' + ] + + const args = [ + ...covArgs, + ...files, + ...progress, '--ui', 'bdd', - '--timeout', timeout - ].filter(Boolean) - - let files = [ - 'test/node.{js,ts}', - 'test/**/*.spec.{js,ts}' + `--timeout=${argv.timeout}` ] - if (argv.colors) { - args.push('--colors') - } else { - args.push('--no-colors') - } - if (argv.grep) { args.push(`--grep=${argv.grep}`) } - if (argv.invert) { - args.push('--invert') - } - - if (argv.files && argv.files.length > 0) { - files = argv.files - } - - if (argv.verbose) { - args.push('--verbose') - } - if (argv.watch) { args.push('--watch') } - if (argv.exit) { - args.push('--exit') - } - if (argv.bail) { args.push('--bail') } if (argv.tsRepo) { - args.push(...['--require', fromAegir('src/config/register.js')]) + args.push(...['--require', require.resolve('esbuild-register')]) } - const postHook = hook('node', 'post') - const preHook = hook('node', 'pre') - - if (argv['100']) { - args = [ - '--check-coverage', - '--branches=100', - '--functions=100', - '--lines=100', - '--statements=100', - exec - ].concat(args) - exec = 'nyc' + if (argv['--']) { + args.push(...argv['--']) } - return preHook(argv) - .then((hook = {}) => { - return execa(exec, - args.concat(files.map((p) => path.normalize(p))), - merge( - { - env: { - ...env, - ...hook.env - }, - preferLocal: true, - localDir: path.join(__dirname, '../..'), - stdio: 'inherit' - }, - execaOptions - ) - ) - }) - .then(() => postHook(argv)) + // before hook + const before = await argv.fileConfig.test.before(argv) + const beforeEnv = before && before.env ? before.env : {} + + // run mocha + await execa(exec, args, + merge( + { + env: { + AEGIR_RUNNER: 'node', + NODE_ENV: process.env.NODE_ENV || 'test', + ...beforeEnv + }, + preferLocal: true, + localDir: path.join(__dirname, '../..'), + stdio: 'inherit' + }, + execaOptions + ) + ) + // after hook + await argv.fileConfig.test.after(argv, before) } module.exports = testNode diff --git a/src/ts/index.js b/src/ts/index.js index 6dd9d2975..8c0133d9c 100644 --- a/src/ts/index.js +++ b/src/ts/index.js @@ -12,10 +12,9 @@ const hasConfig = hasFile('tsconfig.json') * @typedef {import("yargs").Arguments} Arguments * @typedef {import("../types").GlobalOptions} GlobalOptions * @typedef {import("../types").TSOptions} TSOptions - * @typedef {import("../types").BuildOptions} BuildOptions * * @typedef {Object} Options - * @property {"config" | "check" | "types"} preset + * @property {"config" | "check" | "types" | undefined} preset * @property {string[]} forwardOptions - Extra options to forward to the backend * @property {string[]} extraInclude - Extra include files for the TS Config * @property {boolean} tsRepo - Typescript repo support. @@ -26,7 +25,7 @@ const hasConfig = hasFile('tsconfig.json') /** * Typescript command * - * @param {GlobalOptions & TSOptions & BuildOptions} argv + * @param {GlobalOptions & TSOptions} argv */ module.exports = async (argv) => { /** @type {Options} */ @@ -134,7 +133,7 @@ const types = async (userTSConfig, opts) => { declarationMap: true }, include: opts.extraInclude, - exclude: ['test'] + exclude: ['test', '.aegir.js'] } ]) ) diff --git a/src/ts/typedoc-plugin.js b/src/ts/typedoc-plugin.js index 3c875d8ff..68cc68e18 100644 --- a/src/ts/typedoc-plugin.js +++ b/src/ts/typedoc-plugin.js @@ -3,9 +3,14 @@ const { Converter } = require('typedoc/dist/lib/converter') const path = require('path') const fs = require('fs') -module.exports = function (PluginHost) { +/** + * + * @param {import("typedoc/dist/lib/utils").PluginHost} PluginHost + */ +const plugin = function (PluginHost) { const app = PluginHost.owner const pkg = path.join(process.cwd(), 'package.json') + /** @type {any} */ let pkgJson try { @@ -22,6 +27,7 @@ module.exports = function (PluginHost) { if (pkgJson && reflection.name === 'export=') { let name if (node) { + // @ts-ignore name = node.symbol.escapedName } reflection.name = `${name || 'default'}` @@ -29,3 +35,5 @@ module.exports = function (PluginHost) { } app.converter.on(Converter.EVENT_CREATE_DECLARATION, cb) } + +module.exports = plugin diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 000000000..e4ecc1005 --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1,304 @@ +import type esbuild from 'esbuild' +/** + * Options for CLI and local file config + */ +interface Options extends GlobalOptions { + /** + * Options for the `build` command + */ + build: BuildOptions + /** + * Options for the `ts` command + */ + ts: TSOptions + /** + * Options for the `docs` command + */ + docs: DocsOptions + /** + * Options for the `lint` command + */ + lint: LintOptions + /** + * Options for the `test` command + */ + test: TestOptions + /** + * Options for the `release` command + */ + release: ReleaseOptions + /** + * Options for the `dependency-check` command + */ + dependencyCheck: DependencyCheckOptions +} + +/** + * Partial options for local file config + */ +interface PartialOptions { + /** + * Show debug output. + */ + debug?: boolean + /** + * Enable support for Typescript repos. + */ + tsRepo?: boolean + /** + * Options for the `build` command + */ + build?: Partial + /** + * Options for the `ts` command + */ + ts?: Partial + /** + * Options for the `docs` command + */ + docs?: Partial + /** + * Options for the `lint` command + */ + lint?: Partial + /** + * Options for the `test` command + */ + test?: Partial + /** + * Options for the `release` command + */ + release?: Partial + /** + * Options for the `dependency-check` command + */ + dependencyCheck?: DependencyCheckOptions +} + +interface GlobalOptions { + /** + * Show debug output. + */ + debug: boolean + /** + * Enable support for Typescript repos. + */ + tsRepo: boolean + + /** + * Forward options to pass to the backend command populated by yargs parser + */ + '--'?: string[] + /** + * CLI Input + */ + '_'?: string + /** + * Full config from configuration file + */ + fileConfig: Options +} + +interface BuildOptions { + /** + * Build the JS standalone bundle. + */ + bundle: boolean + /** + * Analyse bundle size. Default threshold is 100kB, you can override that in `.aegir.js` with the property `bundlesize.maxSize`. + */ + bundlesize: boolean + /** + * Max threshold for the bundle size. + */ + bundlesizeMax: string + /** + * Build the Typescript type declarations. + */ + types: boolean + /** + * esbuild build options + */ + config: esbuild.BuildOptions +} + +interface TSOptions { + /** + * Preset to run. + */ + preset: 'config' | 'check' | 'types' | undefined + /** + * Values are merged into the local TS config include property. + */ + include: string[] + /** + * Copy .d.ts files from + */ + copyFrom: string + /** + * Copy .d.ts files to + */ + copyTo: string +} + +interface DocsOptions { + /** + * Publish to GitHub Pages + */ + publish: boolean + /** + * Specifies the entry points to be documented by TypeDoc. TypeDoc will examine the exports of these files and create documentation according to the exports. Either files or directories may be specified. If a directory is specified, all source files within the directory will be included as an entry point. + */ + entryPoint: string +} + +interface LintOptions { + /** + * Automatically fix errors if possible. + */ + fix: boolean + /** + * Files to lint. + */ + files: string[] + /** + * Disable eslint output. + */ + silent: boolean +} + +interface TestOptions { + /** + * In which target environment to execute the tests + */ + target: Array<'node' | 'browser' | 'webworker' | 'electron-main' | 'electron-renderer'> + /** + * Watch files for changes and rerun tests + */ + watch: boolean + /** + * Custom globs for files to test + */ + files: string[] + /** + * The default time a single test has to run + */ + timeout: number + /** + * Limit tests to those whose names match given pattern + */ + grep: string + /** + * Bail once a test fails + */ + bail: boolean + /** + * Use progress reporters + */ + progress: boolean + /** + * Enable coverage output + */ + cov: boolean + /** + * Runner enviroment + */ + runner: 'node' | 'browser' | 'webworker' | 'electron-main' | 'electron-renderer' + /** + * Browser options + */ + browser: { + /** + * playwright-test config @see https://github.com/hugomrdias/playwright-test + */ + config: any + } + /** + * Before tests hook + */ + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + before: (options: GlobalOptions & TestOptions) => Promise + /** + * After tests hook + */ + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + after: (options: GlobalOptions & TestOptions, beforeResult: TestBeforeResult | void) => Promise +} + +interface TestBeforeResult { + env?: NodeJS.ProcessEnv +} + +interface ReleaseOptions { + build: boolean + types: boolean + test: boolean + lint: boolean + contributors: boolean + bump: boolean + changelog: boolean + publish: boolean + commit: boolean + tag: boolean + push: boolean + /** + * Generate GitHub release + */ + ghrelease: boolean + /** + * Generate and publish documentation + */ + docs: boolean + /** + * Access token for generating GitHub releases + */ + ghtoken: string + /** + * The type of version bump for this release + */ + type: 'major' | 'minor' | 'patch' | 'prepatch' | 'preminor' | 'premajor' | 'prerelease' + /** + * Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. + */ + preid?: string + /** + * The npm tag to publish to + */ + distTag: string + /** + * Git remote + */ + remote: string +} + +interface DependencyCheckOptions { + /** + * Files to check + */ + input: string[] + /** + * Check production dependencies and paths only + */ + productionOnly: boolean + /** + * Ignore these dependencies when considering which are used and which are not + */ + ignore: string[] + /** + * Files to check when in production only mode + */ + productionInput: string[] +} + +export type { + PartialOptions, + Options, + GlobalOptions, + BuildOptions, + TSOptions, + DocsOptions, + LintOptions, + TestOptions, + ReleaseOptions, + DependencyCheckOptions +} diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index 63fe49c70..000000000 --- a/src/types.ts +++ /dev/null @@ -1,122 +0,0 @@ - -/** - * Options for CLI and local file config - * - * - */ -interface Options extends GlobalOptions { - /** - * Options for the `build` command - */ - build: BuildOptions - /** - * Options for the `ts` command - */ - ts: TSOptions - /** - * Options for the `docs` command - */ - docs: DocsOptions - /** - * Options for the `lint` command - */ - lint: LintOptions -} - -interface GlobalOptions { - /** - * Show debug output. - */ - debug: boolean - /** - * Flag to control if bundler should inject node globals or built-ins. - */ - node: boolean - /** - * Enable support for Typescript repos. - */ - tsRepo: boolean - - /** - * Forward options to pass to the backend command populated by yargs parser - */ - '--'?: string[] - - /** - * CLI Input - */ - '_'?: string -} - -interface BuildOptions { - /** - * Build the JS standalone bundle. - */ - bundle: boolean - /** - * Analyse bundle size. Default threshold is 100kB, you can override that in `.aegir.js` with the property `bundlesize.maxSize`. - */ - bundlesize: boolean - /** - * Max threshold for the bundle size. - */ - bundlesizeMax: string - /** - * Build the Typescripts type declarations. - */ - types: boolean -} - -interface TSOptions { - /** - * Preset to run. - */ - preset: 'config' | 'check' | 'types' - /** - * Values are merged into the local TS config include property. - */ - include: string[] - /** - * Copy .d.ts files from - */ - copyFrom: string - /** - * Copy .d.ts files to - */ - copyTo: string -} - -interface DocsOptions { - /** - * Publish to GitHub Pages - */ - publish: boolean - /** - * Specifies the entry points to be documented by TypeDoc. TypeDoc will examine the exports of these files and create documentation according to the exports. Either files or directories may be specified. If a directory is specified, all source files within the directory will be included as an entry point. - */ - entryPoint: string -} - -interface LintOptions { - /** - * Automatically fix errors if possible. - */ - fix: boolean - /** - * Files to lint. - */ - files: string[] - /** - * Disable eslint output. - */ - silent: boolean -} - -export type { - Options, - GlobalOptions, - BuildOptions, - TSOptions, - DocsOptions, - LintOptions -} diff --git a/src/update-last-successful-build/index.js b/src/update-last-successful-build/index.js deleted file mode 100644 index 6ef7f2200..000000000 --- a/src/update-last-successful-build/index.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict' - -const { - exec -} = require('../utils') - -async function findCurrentBranch () { - const result = await exec('cat', ['.git/HEAD']) - - return result.stdout.replace('ref: ', '').trim() -} - -async function findMasterCommit (opts) { - const result = await exec('git', ['show-ref', '-s', `${opts.remote}/master`]) - - return result.stdout.trim() -} - -async function isHeadOfMaster (opts) { - const master = await findMasterCommit(opts) - const branch = await findCurrentBranch() - - // we either have master checked out or a single commit - return branch === 'refs/heads/master' || branch === master -} - -async function updateLastSuccessfulBuild (opts) { - if (!isHeadOfMaster(opts)) { - console.info('Will only run on the master branch') // eslint-disable-line no-console - - return - } - - console.info('Fetching latest') // eslint-disable-line no-console - await exec('git', ['fetch']) - - const tempBranch = 'update-branch-' + Date.now() - - console.info('Creating temp branch') // eslint-disable-line no-console - await exec('git', ['checkout', '-b', tempBranch]) - - console.info('Removing dependencies') // eslint-disable-line no-console - await exec('rm', ['-rf', 'node_modules', 'package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json']) - - console.info('Installing dependencies') // eslint-disable-line no-console - await exec('npm', ['install', '--production']) - - console.info('Removing package-lock.json') // eslint-disable-line no-console - await exec('rm', ['-rf', 'package-lock.json']) // removing package-lock after install prevents dev deps being added to the shrinkwrap file - - console.info('Creating npm-shrinkwrap.json') // eslint-disable-line no-console - await exec('npm', ['shrinkwrap']) - - console.info('Creating yarn.lock') // eslint-disable-line no-console - await exec('yarn', [], { - env: { - NODE_ENV: 'production' - } - }) - - try { - console.info('Committing') // eslint-disable-line no-console - await exec('git', ['add', '-f', 'npm-shrinkwrap.json', 'yarn.lock']) - await exec('git', ['commit', '-m', opts.message]) - } catch (err) { - if (err.message.includes('nothing to commit, working tree clean')) { - console.info('No changes detected, nothing to do') // eslint-disable-line no-console - return - } - - throw err - } - - try { - console.info(`Deleting remote ${opts.branch} branch`) // eslint-disable-line no-console - await exec('git', ['push', opts.remote, `:${opts.branch}`], { - quiet: true - }) - } catch (err) { - if (!err.message.includes('remote ref does not exist')) { - throw err - } - } - - console.info(`Pushing ${opts.branch} branch`) // eslint-disable-line no-console - await exec('git', ['push', opts.remote, `${tempBranch}:${opts.branch}`], { - quiet: true - }) -} - -module.exports = updateLastSuccessfulBuild diff --git a/src/update-rc/index.js b/src/update-rc/index.js deleted file mode 100644 index b3b23b2fd..000000000 --- a/src/update-rc/index.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict' - -const { - exec -} = require('../utils') -const release = require('../release') - -async function updateRc (opts) { - await exec('git', ['checkout', 'master']) - - try { - console.info(`Removing local copy of ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['branch', '-D', opts.branch]) - } catch (err) { - if (!err.message.includes(`branch '${opts.branch}' not found`)) { - throw err - } - } - - console.info('Fetching repo history') // eslint-disable-line no-console - await exec('git', ['fetch']) - - console.info(`Checking out branch ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['checkout', '--track', `${opts.remote}/${opts.branch}`]) - - console.info('Removing dependencies') // eslint-disable-line no-console - await exec('rm', ['-rf', 'node_modules', 'package-lock.json']) - - console.info('Installing dependencies') // eslint-disable-line no-console - await exec('npm', ['ci']) - - console.info('Updating', opts.preId) // eslint-disable-line no-console - await release({ - type: 'prerelease', - preid: opts.preId, - 'dist-tag': opts.distTag, - build: false, - test: false, - lint: false, - docsFormats: ['html'], - contributors: true, - bump: true, - changelog: true, - publish: true, - ghrelease: true, - docs: true, - ghtoken: opts.ghtoken || process.env.AEGIR_GHTOKEN, - remote: opts.remote - }) -} - -module.exports = updateRc diff --git a/src/update-release-branch-lockfiles/index.js b/src/update-release-branch-lockfiles/index.js deleted file mode 100644 index 9973198df..000000000 --- a/src/update-release-branch-lockfiles/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' - -const { - exec -} = require('../utils') - -async function updateReleaseBranchLockfiles (opts) { - // when (eventually) run on CI, deps should already be present so need to - // remove the lines that remove the node_modules folder - await exec('git', ['checkout', 'master']) - - try { - console.info(`Removing local copy of ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['branch', '-D', opts.branch]) - } catch (err) { - if (!err.message.includes(`branch '${opts.branch}' not found`)) { - throw err - } - } - - console.info('Fetching repo history') // eslint-disable-line no-console - await exec('git', ['fetch']) - - console.info(`Checking out branch ${opts.branch}`) // eslint-disable-line no-console - await exec('git', ['checkout', '--track', `${opts.remote}/${opts.branch}`]) - - console.info('Removing dependencies') // eslint-disable-line no-console - await exec('rm', ['-rf', 'node_modules', 'package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json']) - - console.info('Installing dependencies') // eslint-disable-line no-console - await exec('npm', ['install', '--production']) - - console.info('Removing package-lock.json') // eslint-disable-line no-console - await exec('rm', ['-rf', 'package-lock.json']) // removing package-lock after install prevents dev deps being added to the shrinkwrap file - - console.info('Creating npm-shrinkwrap.json') // eslint-disable-line no-console - await exec('npm', ['shrinkwrap']) - - console.info('Creating yarn.lock') // eslint-disable-line no-console - await exec('yarn', [], { - env: { - NODE_ENV: 'production' - } - }) - - try { - console.info('Committing') // eslint-disable-line no-console - await exec('git', ['add', '-f', 'npm-shrinkwrap.json', 'yarn.lock']) - await exec('git', ['commit', '-m', opts.message]) - } catch (err) { - if (err.message.includes('nothing to commit, working tree clean')) { - console.info('No changes detected, nothing to do') // eslint-disable-line no-console - return - } - - throw err - } - - console.info(`Pushing ${opts.branch} branch`) // eslint-disable-line no-console - await exec('git', ['push', opts.remote, `${opts.branch}:${opts.branch}`], { - quiet: true - }) -} - -module.exports = updateReleaseBranchLockfiles diff --git a/src/utils.js b/src/utils.js index 9c85e2b63..bdabd2462 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ /** * Various utility methods used in AEgir. * @@ -12,12 +13,16 @@ const stripComments = require('strip-json-comments') const stripBom = require('strip-bom') const { download } = require('@electron/get') const path = require('path') +const readline = require('readline') const readPkgUp = require('read-pkg-up') const fs = require('fs-extra') const execa = require('execa') - +const envPaths = require('env-paths')('aegir', { suffix: '' }) +const lockfile = require('proper-lockfile') const { + // @ts-ignore packageJson: pkg, + // @ts-ignore path: pkgPath } = readPkgUp.sync({ cwd: fs.realpathSync(process.cwd()) @@ -27,11 +32,18 @@ const SRC_FOLDER = 'src' const TEST_FOLDER = 'test' exports.pkg = pkg -// TODO: get this from aegir package.json -exports.browserslist = '>1% or node >=10 and not ie 11 and not dead' exports.repoDirectory = path.dirname(pkgPath) +/** + * @param {string[]} p + */ exports.fromRoot = (...p) => path.join(exports.repoDirectory, ...p) +/** + * @param {string[]} p + */ exports.hasFile = (...p) => fs.existsSync(exports.fromRoot(...p)) +/** + * @param {string[]} p + */ exports.fromAegir = (...p) => path.join(__dirname, '..', ...p) exports.hasTsconfig = exports.hasFile('tsconfig.json') @@ -78,20 +90,6 @@ exports.getListrConfig = () => { } } -// @ts-ignore -exports.hook = (env, key) => (ctx) => { - if (ctx && ctx.hooks) { - if (ctx.hooks[env] && ctx.hooks[env][key]) { - return ctx.hooks[env][key]() - } - if (ctx.hooks[key]) { - return ctx.hooks[key]() - } - } - - return Promise.resolve() -} - /** * @param {string} command * @param {string[] | undefined} args @@ -101,10 +99,12 @@ exports.exec = (command, args, options = {}) => { const result = execa(command, args, options) if (!options.quiet) { - result.stdout?.pipe(process.stdout) + // @ts-ignore + result.stdout.pipe(process.stdout) } - result.stderr?.pipe(process.stderr) + // @ts-ignore + result.stderr.pipe(process.stderr) return result } @@ -128,7 +128,25 @@ function getPlatformPath () { } exports.getElectron = async () => { + // @ts-ignore const pkg = require('./../package.json') + + const lockfilePath = path.join(envPaths.cache, '__electron-lock') + fs.mkdirpSync(envPaths.cache) + const releaseLock = await lockfile.lock(envPaths.cache, { + retries: { + retries: 10, + // Retry 20 times during 10 minutes with + // exponential back-off. + // See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions + factor: 1.27579 + }, + onCompromised: (err) => { + throw new Error(`${err.message} Path: ${lockfilePath}`) + }, + lockfilePath + }) + const version = pkg.devDependencies.electron.slice(1) const spinner = ora(`Downloading electron: ${version}`).start() const zipPath = await download(version) @@ -137,7 +155,8 @@ exports.getElectron = async () => { spinner.text = 'Extracting electron to system cache' await extract(zipPath, { dir: path.dirname(zipPath) }) } - spinner.succeed('Electron ready to use') + spinner.stop() + await releaseLock() return electronPath } @@ -178,3 +197,29 @@ exports.gzipSize = (path) => { }) }) } + +exports.otp = () => { + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout + }) + const otp = [] + return new Promise((resolve, reject) => { + rl.question('OTP: ', answer => { + resolve(answer) + console.log('\n') + rl.close() + }) + // @ts-ignore + rl._writeToOutput = function _writeToOutput (k) { + otp.push(k) + if (otp.length === 6) { + // @ts-ignore + rl.write(null, { name: 'enter' }) + } else { + // @ts-ignore + rl.output.write('*') + } + } + }) +} diff --git a/test/acceptance.sh b/test/acceptance.sh deleted file mode 100755 index fc081f7af..000000000 --- a/test/acceptance.sh +++ /dev/null @@ -1,55 +0,0 @@ -#! /usr/bin/env bash - -# Acceptance test for making sure aegir works as we want it to - -set -e - -# Debug -# set -x - -echo "## Creating a link to current AEgir" -npm link - -echo "## Creating test directory" -TEST_DIR=$(mktemp -d) - -cd $TEST_DIR - -echo "## Cloning aegir-test-repo" -git clone https://github.com/ipfs/aegir-test-repo - -cd aegir-test-repo - -echo "## Installing dependencies for aegir-test-repo" -npm install - -echo "## Linking current AEgir into aegir-test-repo" -npm link aegir - -echo "## Running build command" -npm run build - -echo "## Making sure right files were created" - -if [ ! -d "dist" ]; then - echo "'dist/' directory wasn't created correctly " - exit 1 -fi - -if [ ! -e "dist/index.js" ]; then - echo "'dist/index.js' file wasn't created correctly " - exit 1 -fi - -if [ ! -e "dist/index.min.js" ]; then - echo "'dist/index.min.js' file wasn't created correctly " - exit 1 -fi - -if [ ! -e "dist/index.min.js.map" ]; then - echo "'dist/index.min.js.map' file wasn't created correctly " - exit 1 -fi - -echo "## Cleaning up" -rm -rf $TEST_DIR diff --git a/test/browser.spec.js b/test/browser.spec.js index ecfd56845..1e8f7ae45 100644 --- a/test/browser.spec.js +++ b/test/browser.spec.js @@ -1,7 +1,7 @@ /* eslint-env mocha */ 'use strict' -const loadFixture = require('../fixtures') +const loadFixture = require('../utils/fixtures') const expect = require('chai').expect describe('browser', () => { diff --git a/test/config/fixtures/custom-config-package-json/package.json b/test/config/fixtures/custom-config-package-json/package.json index 70ca3c2cf..a7f1f0962 100644 --- a/test/config/fixtures/custom-config-package-json/package.json +++ b/test/config/fixtures/custom-config-package-json/package.json @@ -1,6 +1,6 @@ { "name": "custom-config", "aegir": { - "custom": true + "debug": true } } \ No newline at end of file diff --git a/test/config/fixtures/custom-config/.aegir.js b/test/config/fixtures/custom-config/.aegir.js index ee8844250..a07a84c50 100644 --- a/test/config/fixtures/custom-config/.aegir.js +++ b/test/config/fixtures/custom-config/.aegir.js @@ -1,14 +1,3 @@ module.exports = { - webpack: { - devtool: 'eval' - }, - entry: 'src/main.js', - hooks: { - pre() { - return Promise.resolve('pre'); - }, - post() { - return Promise.resolve('post'); - } - } + }; diff --git a/test/config/fixtures/custom-user-async-hooks/.aegir.js b/test/config/fixtures/custom-user-async-hooks/.aegir.js index 138dd46d0..faaaaedec 100644 --- a/test/config/fixtures/custom-user-async-hooks/.aegir.js +++ b/test/config/fixtures/custom-user-async-hooks/.aegir.js @@ -1,15 +1,11 @@ module.exports = { - webpack: { - devtool: 'eval' - }, - entry: 'src/main.js', - hooks: { - async pre () { + test: { + async before () { await Promise.resolve() return 'pre done async' }, - async post () { + async after () { await Promise.resolve() return 'post done async' diff --git a/test/config/user.js b/test/config/user.js index 62fb4fbd0..fd3423227 100644 --- a/test/config/user.js +++ b/test/config/user.js @@ -6,29 +6,26 @@ const { config } = require('../../src/config/user') const path = require('path') describe('config - user', () => { - it('custom config', () => { + it('custom config', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-config')) - expect(conf).to.have.property('webpack').eql({ - devtool: 'eval' - }) - expect(conf).to.have.property('entry', 'src/main.js') + expect(conf).to.have.property('debug').eql(false) + expect(conf).to.have.property('tsRepo').eql(false) + expect(conf).to.have.nested.property('test.before') + expect(conf).to.have.nested.property('test.after') - expect(conf.hooks).to.have.nested.property('browser.pre') - expect(conf.hooks).to.have.nested.property('browser.post') - expect(conf.hooks).to.have.nested.property('node.pre') - expect(conf.hooks).to.have.nested.property('node.post') - - return conf.hooks.browser.pre().then((res) => { - expect(res).to.eql('pre') - }) + // @ts-ignore + const res = await conf.test.before() + expect(res).to.eql(undefined) }) it('supports async hooks', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-user-async-hooks')) - expect(await conf.hooks.browser.pre()).to.eql('pre done async') - expect(await conf.hooks.browser.post()).to.eql('post done async') + // @ts-ignore + expect(await conf.test.before()).to.eql('pre done async') + // @ts-ignore + expect(await conf.test.after()).to.eql('post done async') }) - it('supports async hooks', async () => { + it('supports package.json aegir property', async () => { const conf = config(path.join(__dirname, 'fixtures/custom-config-package-json')) - expect(await conf.custom).to.ok() + expect(conf.debug).to.ok() }) }) diff --git a/test/dependants.js b/test/dependants.js index 9c221efe0..d0fbbb8ae 100644 --- a/test/dependants.js +++ b/test/dependants.js @@ -8,39 +8,53 @@ const path = require('path') const bin = require.resolve('../') const os = require('os') +/** @type {any} */ const dirs = {} -const git = { - init: async (name) => { - const source = path.join(__dirname, 'fixtures', 'test-dependant', name) - dirs[name] = path.join(os.tmpdir(), `repo-${Math.random()}`) +const git = + { + /** + * @param {string} name + */ + init: async (name) => { + const source = path.join(__dirname, 'fixtures', 'test-dependant', name) + dirs[name] = path.join(os.tmpdir(), `repo-${Math.random()}`) - await fs.mkdir(dirs[name]) - await fs.copy(source, dirs[name]) + await fs.mkdir(dirs[name]) + await fs.copy(source, dirs[name]) - await execa('git', ['init'], { - cwd: dirs[name] - }) - await execa('git', ['config', 'user.email', 'test@test.com'], { - cwd: dirs[name] - }) - await execa('git', ['config', 'user.name', 'test'], { - cwd: dirs[name] - }) - await git.add(name) - await git.commit(name, 'initial commit') - }, - add: async (name) => { - await execa('git', ['add', '-A'], { - cwd: dirs[name] - }) - }, - commit: async (name, message) => { - await execa('git', ['commit', '-m', message, '--no-gpg-sign'], { - cwd: dirs[name] - }) - } -} + await execa('git', ['init'], { + cwd: dirs[name] + }) + await execa('git', ['config', 'user.email', 'test@test.com'], { + cwd: dirs[name] + }) + await execa('git', ['config', 'user.name', 'test'], { + cwd: dirs[name] + }) + await git.add(name) + await git.commit(name, 'initial commit') + }, + /** + * + * @param {string} name + */ + add: async (name) => { + await execa('git', ['add', '-A'], { + cwd: dirs[name] + }) + }, + /** + * + * @param {string} name + * @param {string} message + */ + commit: async (name, message) => { + await execa('git', ['commit', '-m', message, '--no-gpg-sign'], { + cwd: dirs[name] + }) + } + } describe('dependants', function () { this.timeout(120000) diff --git a/test/dependency-check.js b/test/dependency-check.js index e1da06952..8fa1d6c94 100644 --- a/test/dependency-check.js +++ b/test/dependency-check.js @@ -1,89 +1,124 @@ /* eslint-env mocha */ 'use strict' -const check = require('../src/dependency-check') +const { check } = require('../src/dependency-check') const { expect } = require('../utils/chai') const path = require('path') const merge = require('merge-options') +const { userConfig } = require('../src/config/user') // returns an object that looks like the yargs input const yargsv = (overrides = {}) => { const argv = { - _: [ - 'dependency-check' - ], - input: check.defaultInput, - ignore: [] + _: ['dependency-check'], + input: userConfig.dependencyCheck.input, + productionOnly: false, + productionInput: userConfig.dependencyCheck.productionInput, + ignore: [], + fileConfig: userConfig } return merge(argv, overrides) } -const argv = (input = []) => { - return [ - 'node', 'aegir', 'dependency-check' - ].concat(input) -} - describe('dependency check', () => { it('should fail for missing deps', async () => { - await expect(check(yargsv(), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/fail') - })).to.eventually.be.rejectedWith('execa') + await expect( + check(yargsv(), { + cwd: path.join(__dirname, 'fixtures/dependency-check/fail') + }) + ).to.eventually.be.rejectedWith('execa') }) it('should pass when there are no missing deps', async () => { - await expect(check(yargsv(), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/pass') - })).to.eventually.be.fulfilled() + await expect( + check(yargsv(), { + cwd: path.join(__dirname, 'fixtures/dependency-check/pass') + }) + ).to.eventually.be.fulfilled() }) it('should forward options', async () => { - await expect(check(yargsv({ '--': ['--unused'] }), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/pass') - })).to.eventually.be.rejectedWith('Modules in package.json not used in code: pico') + await expect( + check(yargsv({ '--': ['--unused'] }), { + cwd: path.join(__dirname, 'fixtures/dependency-check/pass') + }) + ).to.eventually.be.rejectedWith( + 'Modules in package.json not used in code: pico' + ) }) it('should fail for missing production deps', async () => { - await expect(check(yargsv({ productionOnly: true }), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/fail-prod') - })).to.eventually.be.rejectedWith('execa') + await expect( + check(yargsv({ productionOnly: true }), { + cwd: path.join(__dirname, 'fixtures/dependency-check/fail-prod') + }) + ).to.eventually.be.rejectedWith('execa') }) it('should pass for passed files', async () => { const file = 'derp/foo.js' - await expect(check(yargsv({ - input: [file] - }), argv(file), { - cwd: path.join(__dirname, 'fixtures/dependency-check/pass-certain-files') - })).to.eventually.be.fulfilled() + await expect( + check( + yargsv({ + input: [file] + }), + { + cwd: path.join( + __dirname, + 'fixtures/dependency-check/pass-certain-files' + ) + } + ) + ).to.eventually.be.fulfilled() }) it('should pass for passed production files', async () => { const file = 'derp/foo.js' - await expect(check(yargsv({ - productionOnly: true, - input: [file] - }), argv(file), { - cwd: path.join(__dirname, 'fixtures/dependency-check/pass-certain-files') - })).to.eventually.be.fulfilled() + await expect( + check( + yargsv({ + productionOnly: true, + input: [file] + }), + { + cwd: path.join( + __dirname, + 'fixtures/dependency-check/pass-certain-files' + ) + } + ) + ).to.eventually.be.fulfilled() }) it('should pass for ignored modules', async () => { - await expect(check(yargsv({ - ignore: ['execa'] - }), argv(), { - cwd: path.join(__dirname, 'fixtures/dependency-check/fail') - })).to.eventually.be.fulfilled() + await expect( + check( + yargsv({ + ignore: ['execa'] + }), + { + cwd: path.join(__dirname, 'fixtures/dependency-check/fail') + } + ) + ).to.eventually.be.fulfilled() }) it('should pass for modules used in .aegir.js', async () => { - await expect(check(yargsv({ - '--': ['--unused'] - }), argv(['--', '--unused']), { - cwd: path.join(__dirname, 'fixtures/dependency-check/with-aegir-config') - })).to.eventually.be.fulfilled() + await expect( + check( + yargsv({ + '--': ['--unused'] + }), + { + cwd: path.join( + __dirname, + 'fixtures/dependency-check/with-aegir-config' + ) + } + ) + ).to.eventually.be.fulfilled() }) }) diff --git a/test/fixtures.js b/test/fixtures.js index 587086749..b12e67aa3 100644 --- a/test/fixtures.js +++ b/test/fixtures.js @@ -1,14 +1,14 @@ /* eslint-env mocha */ 'use strict' -const loadFixture = require('../fixtures') +const loadFixture = require('../utils/fixtures') const { expect } = require('../utils/chai') const path = require('path') describe('fixtures', () => { it('should load fixtures from dependencies', () => { const myFixture = loadFixture('package.json', 'mocha') - expect(JSON.parse(myFixture).name).to.be.eql('mocha') + expect(JSON.parse(myFixture.toString()).name).to.be.eql('mocha') }) it('should load local fixtures', () => { diff --git a/test/fixtures/dependency-check/fail-prod/index.js b/test/fixtures/dependency-check/fail-prod/index.js index 1745c39f3..2d603b5f0 100644 --- a/test/fixtures/dependency-check/fail-prod/index.js +++ b/test/fixtures/dependency-check/fail-prod/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const execa = require('execa') diff --git a/test/fixtures/dependency-check/fail/index.js b/test/fixtures/dependency-check/fail/index.js index 1745c39f3..2d603b5f0 100644 --- a/test/fixtures/dependency-check/fail/index.js +++ b/test/fixtures/dependency-check/fail/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const execa = require('execa') diff --git a/test/fixtures/dependency-check/pass-certain-files/derp/foo.js b/test/fixtures/dependency-check/pass-certain-files/derp/foo.js index 1745c39f3..2d603b5f0 100644 --- a/test/fixtures/dependency-check/pass-certain-files/derp/foo.js +++ b/test/fixtures/dependency-check/pass-certain-files/derp/foo.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const execa = require('execa') diff --git a/test/fixtures/dependency-check/pass-certain-files/index.js b/test/fixtures/dependency-check/pass-certain-files/index.js index 9ec021827..1b23eb4a9 100644 --- a/test/fixtures/dependency-check/pass-certain-files/index.js +++ b/test/fixtures/dependency-check/pass-certain-files/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const pico = require('pico') diff --git a/test/fixtures/dependency-check/pass/index.js b/test/fixtures/dependency-check/pass/index.js index 9fadebd1b..165acb9d5 100644 --- a/test/fixtures/dependency-check/pass/index.js +++ b/test/fixtures/dependency-check/pass/index.js @@ -1,4 +1,5 @@ 'use strict' /* eslint-disable no-unused-vars */ +// @ts-ignore const execa = require('execa') diff --git a/test/fixtures/dependency-check/with-aegir-config/index.js b/test/fixtures/dependency-check/with-aegir-config/index.js index 9ec021827..1b23eb4a9 100644 --- a/test/fixtures/dependency-check/with-aegir-config/index.js +++ b/test/fixtures/dependency-check/with-aegir-config/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' /* eslint-disable no-unused-vars */ const pico = require('pico') diff --git a/test/fixtures/test-dependant/monorepo/packages/submodule/test.js b/test/fixtures/test-dependant/monorepo/packages/submodule/test.js index e4bfac0af..79eb73902 100644 --- a/test/fixtures/test-dependant/monorepo/packages/submodule/test.js +++ b/test/fixtures/test-dependant/monorepo/packages/submodule/test.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' const pkg = require('it-all/package.json') diff --git a/test/fixtures/test-dependant/project/test.js b/test/fixtures/test-dependant/project/test.js index e4bfac0af..79eb73902 100644 --- a/test/fixtures/test-dependant/project/test.js +++ b/test/fixtures/test-dependant/project/test.js @@ -1,3 +1,4 @@ +// @ts-nocheck 'use strict' const pkg = require('it-all/package.json') diff --git a/test/lint.js b/test/lint.js index 644c45858..89029f800 100644 --- a/test/lint.js +++ b/test/lint.js @@ -10,6 +10,9 @@ const { userConfig } = require('../src/config/user') const TEMP_FOLDER = path.join(__dirname, '../node_modules/.temp-test') +/** + * @param {{ [s: string]: any; } | ArrayLike} project + */ const setupProject = async (project) => { const tmpDir = path.join(TEMP_FOLDER, `test-${Math.random()}`) await fs.promises.mkdir(tmpDir) @@ -19,6 +22,9 @@ const setupProject = async (project) => { process.chdir(tmpDir) } +/** + * @param {never[]} deps + */ const setupProjectWithDeps = deps => setupProject({ 'package.json': JSON.stringify({ name: 'my-project', @@ -26,16 +32,32 @@ const setupProjectWithDeps = deps => setupProject({ }) }) +/** + * @param {{ [s: string]: any; } | ArrayLike} project + */ const projectShouldPassLint = async (project) => { await setupProject(project) - await lint(userConfig.lint) + await lint.run({ + fileConfig: userConfig, + debug: false, + tsRepo: false, + ...userConfig.lint + }) } +/** + * @param {{ [s: string]: any; } | ArrayLike} project + */ const projectShouldFailLint = async (project) => { await setupProject(project) let failed = false try { - await lint(userConfig.lint) + await lint.run({ + fileConfig: userConfig, + debug: false, + tsRepo: false, + ...userConfig.lint + }) } catch (error) { failed = true expect(error.message).to.contain('Lint errors') @@ -57,7 +79,14 @@ describe('lint', () => { it('lint itself (aegir)', function () { this.timeout(20 * 1000) // slow ci is slow - return lint({ fix: false, silent: true, files: userConfig.lint.files }) + return lint.run({ + fileConfig: userConfig, + debug: false, + tsRepo: false, + fix: false, + silent: true, + files: userConfig.lint.files + }) }) it('should pass in user defined path globs', () => { @@ -69,7 +98,10 @@ describe('lint', () => { fs.mkdirSync(dir) fs.writeFileSync(`${dir}/test-pass.js`, '\'use strict\'\n\nmodule.exports = {}\n') }) - .then(() => lint({ + .then(() => lint.run({ + fileConfig: userConfig, + debug: false, + tsRepo: false, fix: false, silent: true, files: [`${dir}/*.js`] @@ -84,7 +116,10 @@ describe('lint', () => { fs.mkdirSync(dir) fs.writeFileSync(`${dir}/test-fail.js`, '() .> {') - await expect(lint({ + await expect(lint.run({ + fileConfig: userConfig, + debug: false, + tsRepo: false, fix: false, silent: true, files: [`${dir}/*.js`] @@ -94,7 +129,12 @@ describe('lint', () => { it('should lint ts and js with different parsers rules', async () => { process.chdir(path.join(__dirname, './fixtures/js+ts/')) - await lint(userConfig.lint) + await lint.run({ + fileConfig: userConfig, + debug: false, + tsRepo: false, + ...userConfig.lint + }) }) it('should pass if no .eslintrc found and does not follows ipfs eslint rules', async () => { diff --git a/test/node.js b/test/node.js index fa839510d..37fb17c47 100644 --- a/test/node.js +++ b/test/node.js @@ -1,6 +1,5 @@ 'use strict' -require('./utils') require('./lint') require('./fixtures') require('./dependants') diff --git a/test/utils.js b/test/utils.js deleted file mode 100644 index 1d0bf491b..000000000 --- a/test/utils.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-env mocha */ -'use strict' - -const { expect } = require('../utils/chai') - -const utils = require('../src/utils') - -describe('utils', () => { - it('hook', () => { - const res = utils.hook('node', 'pre')({ - hooks: { - node: { - pre () { - return Promise.resolve(10) - } - } - } - }) - - return Promise.all([ - res, - utils.hook('node', 'pre')({ hooks: {} }), - utils.hook('node', 'pre')({ hooks: { browser: { pre: {} } } }) - ]).then((results) => { - expect(results).to.eql([ - 10, - undefined, - undefined - ]) - }) - }) -}) diff --git a/test/utils/echo-server.js b/test/utils/echo-server.js index 44988d64c..c9cd3dab6 100644 --- a/test/utils/echo-server.js +++ b/test/utils/echo-server.js @@ -5,15 +5,17 @@ const http = require('ipfs-utils/src/http') const { Buffer } = require('buffer') const { expect } = require('../../utils/chai') const EchoServer = require('../../utils/echo-server') +// @ts-ignore const { format } = require('iso-url') describe('echo server spec', () => { const echo = new EchoServer() + /** @type {string} */ let url before(async () => { await echo.start() - const { port, address } = echo.server.address() + const { port, address } = /** @type {import('node:net').AddressInfo} */(echo.server.address()) url = format({ protocol: 'http:', hostname: address, port }) }) @@ -25,13 +27,13 @@ describe('echo server spec', () => { }) it('get with search params', async () => { - const req = await http.get('echo/query', { base: url, searchParams: { test: 1 } }) + const req = await http.get('echo/query', { base: url, searchParams: new URLSearchParams({ test: '1' }) }) const res = await req.text() expect(res).to.be.eq('{"test":"1"}') }) it('get with redirect', async () => { - const req = await http.get('redirect', { base: url, searchParams: { to: `${url}/echo/query?test=1` } }) + const req = await http.get('redirect', { base: url, searchParams: new URLSearchParams({ to: `${url}/echo/query?test=1` }) }) const res = await req.text() expect(res).to.be.eq('{"test":"1"}') }) @@ -43,7 +45,7 @@ describe('echo server spec', () => { }) it('download endpoint with text', async () => { - const req = await http.get('download', { base: url, searchParams: { data: 'hello world' } }) + const req = await http.get('download', { base: url, searchParams: new URLSearchParams({ data: 'hello world' }) }) const res = await req.text() expect(res).to.be.eq('hello world') }) @@ -54,7 +56,7 @@ describe('echo server spec', () => { }) it('download endpoint with arraybuffer', async () => { - const req = await http.get('download', { base: url, searchParams: { data: 'hello world' } }) + const req = await http.get('download', { base: url, searchParams: new URLSearchParams({ data: 'hello world' }) }) const res = Buffer.from(await req.arrayBuffer()) expect(res).to.be.deep.eq(Buffer.from('hello world')) }) diff --git a/tsconfig-types.json b/tsconfig-types.json deleted file mode 100644 index 0fde05491..000000000 --- a/tsconfig-types.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./src/config/tsconfig.aegir.json", - "compilerOptions": { - "outDir": "dist", - "noEmit": false, - "emitDeclarationOnly": true - }, - "include": [ - "utils" - ] -} diff --git a/tsconfig.json b/tsconfig.json index 0c91f476f..7229b48c7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,10 @@ "outDir": "dist" }, "include": [ + "package.json", + "cli.js", "src", - "test" + "test", + "utils" ] } diff --git a/utils/chai.js b/utils/chai.js index f2e403885..9605651ec 100644 --- a/utils/chai.js +++ b/utils/chai.js @@ -7,8 +7,11 @@ chai.use(require('chai-as-promised')) chai.use(require('dirty-chai')) chai.use(require('chai-subset')) +const expect = chai.expect +const assert = chai.assert + module.exports = { - expect: chai.expect, - assert: chai.assert, + expect, + assert, chai } diff --git a/utils/echo-server.js b/utils/echo-server.js index 3298ec056..a770a7d1f 100644 --- a/utils/echo-server.js +++ b/utils/echo-server.js @@ -1,6 +1,6 @@ -// @ts-nocheck 'use strict' +// @ts-ignore const send = require('@polka/send-type') const polka = require('polka') const cors = require('cors') @@ -8,6 +8,37 @@ const http = require('http') const { Buffer } = require('buffer') const getPort = require('./get-port') +/** + * HTTP echo server for testing purposes. + * + * @example + * ```js + * const EchoServer = require('aegir/utils/echo-server') + * const server = new EchoServer() + * await server.start() + * + * // search params echo endpoint + * const req = await fetch('http://127.0.0.1:3000/echo/query?test=one') + * console.log(await req.text()) + * + * // body echo endpoint + * const req = await fetch('http://127.0.0.1:3000/echo', { + * method: 'POST', + * body: '{"key": "value"}' + * }) + * console.log(await req.text()) + * + * // redirect endpoint + * const req = await fetch('http://127.0.0.1:3000/redirect?to=http://127.0.0.1:3000/echo') + * console.log(await req.text()) + * + * // download endpoint + * const req = await fetch('http://127.0.0.1:3000/download?data=helloWorld') + * console.log(await req.text()) + * + * await server.stop() + * ``` + */ class EchoServer { /** * @@ -21,6 +52,8 @@ class EchoServer { this.port = options.port || 3000 this.host = options.host || '127.0.0.1' this.started = false + this.server = http.createServer() + this.polka = polka({ server: this.server }) } async start () { @@ -28,24 +61,23 @@ class EchoServer { if (this.options.findPort !== false) { this.port = await getPort(this.port) } - this.server = http.createServer() - this.polka = polka({ server: this.server }) - .use(cors()) - .use('/redirect', (req, res) => { - send(res, 302, null, { Location: req.query.to }) - }) - .all('/echo/query', (req, res) => { - send(res, 200, req.query) - }) - .all('/echo/headers', (req, res) => { - send(res, 200, req.headers) - }) - .all('/echo', (req, res) => { - send(res, 200, req) - }) - .all('/download', (req, res) => { - send(res, 200, Buffer.from(req.query.data || '')) - }) + this.polka.use(cors()) + this.polka.use('/redirect', (req, res) => { + send(res, 302, null, { Location: req.query.to }) + }) + this.polka.all('/echo/query', (req, res) => { + send(res, 200, req.query) + }) + this.polka.all('/echo/headers', (req, res) => { + send(res, 200, req.headers) + }) + this.polka.all('/echo', (req, res) => { + send(res, 200, req) + }) + this.polka.all('/download', (req, res) => { + // @ts-ignore + send(res, 200, Buffer.from(req.query.data || '')) + }) const listen = new Promise((resolve, reject) => { this.server.once('error', reject) diff --git a/utils/fixtures.browser.js b/utils/fixtures.browser.js new file mode 100644 index 000000000..1c46d7de5 --- /dev/null +++ b/utils/fixtures.browser.js @@ -0,0 +1,78 @@ +/* global self */ +'use strict' + +const { Buffer } = require('buffer') +/** + * Loading fixture files in node and the browser can be painful, that's why aegir provides a method to do this. + * + * @example + * ```js + * // test/awesome.spec.js + * const loadFixture = require('aegir/fixtures') + * + * const myFixture = loadFixture('test/fixtures/largefixture') + * ``` + * The path to the fixture is relative to the module root. + * + * If you write a module like [interface-ipfs-core](https://github.com/ipfs/interface-ipfs-core) + * which is to be consumed by other modules tests you need to pass in a third parameter such that + * the server is able to serve the correct files. + * @example + * ```js + * // awesome-tests module + * const loadFixture = require('aegir/fixtures') + * + * const myFixture = loadFixture('test/fixtures/coolfixture', 'awesome-tests') + * ``` + * + * The folder to be served to the browser by default is `process.cwd()` but can be change in the configuration. + * ```js + * module.exports = { + * test: { + * browser: { + * config: { + * assets: '..', + * } + * } + * } + * } + * ``` + * + * @param {string} filePath + * @param {string} module + */ +function loadFixtures (filePath, module) { + if (module) { + filePath = module + '/' + filePath + } + return syncXhr(filePath) +} + +// @dignifiedquire: I know this is considered bad practice (syncXhr), but it +// makes testing life so much nicer! +/** + * @param {string} filePath + */ +function syncXhr (filePath) { + const target = filePath + + const request = new self.XMLHttpRequest() + request.open('GET', target, false) + request.overrideMimeType('text/plain; charset=x-user-defined') + request.send(null) + + if (request.status === 200) { + const filestream = request.responseText + const res = new Uint8Array(filestream.length) + + for (let i = 0; i < filestream.length; i++) { + res[i] = filestream.charCodeAt(i) & 0xff + } + + return Buffer.from(res) + } else { + throw new Error(`Could not get the Fixture: ${filePath}`) + } +} + +module.exports = loadFixtures diff --git a/utils/fixtures.js b/utils/fixtures.js new file mode 100644 index 000000000..32a70efac --- /dev/null +++ b/utils/fixtures.js @@ -0,0 +1,63 @@ +'use strict' + +const path = require('path') +const fs = require('fs') + +/** + * Loading fixture files in node and the browser can be painful, that's why aegir provides a method to do this. + * + * @example + * ```js + * // test/awesome.spec.js + * const loadFixture = require('aegir/fixtures') + * + * const myFixture = loadFixture('test/fixtures/largefixture') + * ``` + * The path to the fixture is relative to the module root. + * + * If you write a module like [interface-ipfs-core](https://github.com/ipfs/interface-ipfs-core) + * which is to be consumed by other modules tests you need to pass in a third parameter such that + * the server is able to serve the correct files. + * @example + * ```js + * // awesome-tests module + * const loadFixture = require('aegir/fixtures') + * + * const myFixture = loadFixture('test/fixtures/coolfixture', 'awesome-tests') + * ``` + * + * @param {string} filePath + * @param {string} [module] + */ +function loadFixtures (filePath, module = '') { + if (module) { + filePath = path.join(module, filePath) + } + + const paths = [ + path.join(process.cwd(), filePath), + path.join(process.cwd(), 'node_modules', filePath), + resolve(filePath) + ] + + const resourcePath = paths.find(path => fs.existsSync(path)) + + if (!resourcePath) { + throw new Error(`Could not load ${filePath}`) + } + + return fs.readFileSync(resourcePath) +} + +/** + * @param {string} filePath + */ +function resolve (filePath) { + try { + return require.resolve(filePath) + } catch (error) { + // ignore error + return filePath + } +} +module.exports = loadFixtures diff --git a/utils/get-port.js b/utils/get-port.js index 2513544a8..880aa6aa5 100644 --- a/utils/get-port.js +++ b/utils/get-port.js @@ -3,7 +3,15 @@ const { createServer } = require('net') /** - * Get a free port + * Helper to find an available port to put a server listening on. + * + * @example + * ```js + * const getPort = require('aegir/utils/get-port') + * const port = await getPort(3000, '127.0.0.1') + * // if 3000 is available returns 3000 if not returns a free port. + * + * ``` * * @param {number} port * @param {string} host