diff --git a/contributing.md b/contributing.md index 0952d4f4df510b0..041321c78989878 100644 --- a/contributing.md +++ b/contributing.md @@ -203,15 +203,8 @@ In general, all warnings and errors added should have these links attached. Below are the steps to add a new link: -1. Create a new markdown file under the `errors` directory based on - `errors/template.md`: - - ```shell - cp errors/template.md errors/.md - ``` - -2. Add the newly added file to `errors/manifest.json` -3. Add the following url to your warning/error: +1. Run `yarn new-error` which will create the error document and update the manifest automatically. +2. Add the following url to your warning/error: `https://nextjs.org/docs/messages/`. For example, to link to `errors/api-routes-static-export.md` you use the url: diff --git a/docs/advanced-features/custom-error-page.md b/docs/advanced-features/custom-error-page.md index 6dfa999892be1f3..40913ed76eee11e 100644 --- a/docs/advanced-features/custom-error-page.md +++ b/docs/advanced-features/custom-error-page.md @@ -94,3 +94,7 @@ export default function Page({ errorCode, stars }) { The `Error` component also takes `title` as a property if you want to pass in a text message along with a `statusCode`. If you have a custom `Error` component be sure to import that one instead. `next/error` exports the default component used by Next.js. + +### Caveats + +- `Error` currently does not support Next.js [Data Fetching methods](/docs/basic-features/data-fetching.md) like [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation) or [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering). diff --git a/docs/advanced-features/src-directory.md b/docs/advanced-features/src-directory.md index 00a162832382719..6bb496833fd5977 100644 --- a/docs/advanced-features/src-directory.md +++ b/docs/advanced-features/src-directory.md @@ -11,7 +11,7 @@ The `src` directory is very common in many apps and Next.js supports it by defau ## Caveats - `src/pages` will be ignored if `pages` is present in the root directory -- Config files like `next.config.js` and `tsconfig.json` should be inside the root directory, moving them to `src` won't work. Same goes for the [`public` directory](/docs/basic-features/static-file-serving.md) +- Config files like `next.config.js` and `tsconfig.json`, as well as environment variables, should be inside the root directory, moving them to `src` won't work. Same goes for the [`public` directory](/docs/basic-features/static-file-serving.md) ## Related diff --git a/docs/advanced-features/using-mdx.md b/docs/advanced-features/using-mdx.md index fc0411f6b1ecff5..00f6df03a290ac9 100644 --- a/docs/advanced-features/using-mdx.md +++ b/docs/advanced-features/using-mdx.md @@ -118,7 +118,7 @@ Checkout my React component: -export default = ({ children }) => {children} +export default ({ children }) => {children} ``` ### Custom Elements diff --git a/docs/basic-features/environment-variables.md b/docs/basic-features/environment-variables.md index 246c82e081df8a4..43ecd315ad9714e 100644 --- a/docs/basic-features/environment-variables.md +++ b/docs/basic-features/environment-variables.md @@ -76,6 +76,8 @@ export async function getStaticProps() { > CORRECT=pre\$A > ``` +> **Note**: If you are using a `/src` folder, please note that Next.js will load the .env files **only** from the parent folder and **not** from the `/src` folder. + ## Exposing Environment Variables to the Browser By default environment variables are only available in the Node.js environment, meaning they won't be exposed to the browser. @@ -128,11 +130,11 @@ When using the Vercel CLI to deploy make sure you add a [`.vercelignore`](https: ## Test Environment Variables -Apart from `development` and `production` environments, there is a 3rd option available: `test`. In the same way you can set defaults for development or production environments, you can do the same with `.env.test` file for testing environment (though this one is not so common as the previous two). +Apart from `development` and `production` environments, there is a 3rd option available: `test`. In the same way you can set defaults for development or production environments, you can do the same with a `.env.test` file for the `testing` environment (though this one is not as common as the previous two). This one is useful when running tests with tools like `jest` or `cypress` where you need to set specific environment vars only for testing purposes. Test default values will be loaded if `NODE_ENV` is set to `test`, though you usually don't need to do this manually as testing tools will address it for you. -There is a small difference between `test` environment, and both `development` and `production` that you need to bear in mind: `.env.local` won't be loaded, as you expect tests to produce the same results for everyone. This way every test execution will use same env defaults across different executions by ignoring your `.env.local` (which is intended to override the default set). +There is a small difference between `test` environment, and both `development` and `production` that you need to bear in mind: `.env.local` won't be loaded, as you expect tests to produce the same results for everyone. This way every test execution will use the same env defaults across different executions by ignoring your `.env.local` (which is intended to override the default set). > **Note**: similar to Default Environment Variables, `.env.test` file should be included in your repository, but `.env.test.local` shouldn't, as `.env*.local` are intended to be ignored through `.gitignore`. diff --git a/docs/basic-features/fast-refresh.md b/docs/basic-features/fast-refresh.md index 3b5678ba7e60b07..e12dd9749b26418 100644 --- a/docs/basic-features/fast-refresh.md +++ b/docs/basic-features/fast-refresh.md @@ -74,9 +74,9 @@ local state being reset on every edit to a file: and Hooks preserve state). - The file you're editing might have _other_ exports in addition to a React component. -- Sometimes, a file would export the result of calling higher-order component +- Sometimes, a file would export the result of calling a higher-order component like `HOC(WrappedComponent)`. If the returned component is a - class, state will be reset. + class, its state will be reset. - Anonymous arrow functions like `export default () =>
;` cause Fast Refresh to not preserve local component state. For large codebases you can use our [`name-default-component` codemod](/docs/advanced-features/codemods.md#name-default-component). As more of your codebase moves to function components and Hooks, you can expect diff --git a/docs/deployment.md b/docs/deployment.md index 91d806aa3881a38..591ea8aab8a5ee8 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -1,68 +1,67 @@ --- -description: Deploy your Next.js app to production with Vercel and other hosting options. +description: Learn how to deploy your Next.js app to production, either managed or self-hosted. --- # Deployment -## Vercel (Recommended) +Congratulations, you are ready to deploy your Next.js application to production. This document will show how to deploy either managed or self-hosted using the [Next.js Build API](#nextjs-build-api). -The easiest way to deploy Next.js to production is to use the **[Vercel platform](https://vercel.com)** from the creators of Next.js. [Vercel](https://vercel.com) is a cloud platform for static sites, hybrid apps, and Serverless Functions. +## Next.js Build API -### Getting started +`next build` generates an optimized version of your application for production. This standard output includes: -If you haven’t already done so, push your Next.js app to a Git provider of your choice: [GitHub](https://github.com/), [GitLab](https://gitlab.com/), or [BitBucket](https://bitbucket.org/). Your repository can be private or public. +- HTML files for pages using `getStaticProps` or [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md) +- CSS files for global styles or for individually scoped styles +- JavaScript for pre-rendering dynamic content from the Next.js server +- JavaScript for interactivity on the client-side through React -Then, follow these steps: +This output is generated inside the `.next` folder: -1. [Sign up to Vercel](https://vercel.com/signup) (no credit card is required). -2. After signing up, you’ll arrive on the [“Import Project”](https://vercel.com/new) page. Under “From Git Repository”, choose the Git provider you use and set up an integration. (Instructions: [GitHub](https://vercel.com/docs/git/vercel-for-github) / [GitLab](https://vercel.com/docs/git/vercel-for-gitlab) / [BitBucket](https://vercel.com/docs/git/vercel-for-bitbucket)). -3. Once that’s set up, click “Import Project From …” and import your Next.js app. It auto-detects that your app is using Next.js and sets up the build configuration for you. No need to change anything — everything should work fine! -4. After importing, it’ll deploy your Next.js app and provide you with a deployment URL. Click “Visit” to see your app in production. +- `.next/static/chunks/pages` – Each JavaScript file inside this folder relates to the route with the same name. For example, `.next/static/chunks/pages/about.js` would be the JavaScript file loaded when viewing the `/about` route in your application +- `.next/static/media` – Statically imported images from `next/image` are hashed and copied here +- `.next/static/css` – Global CSS files for all pages in your application +- `.next/server/pages` – The HTML and JavaScript entry points prerendered from the server. The `.nft.json` files are created when [Output File Tracing](/docs/advanced-features/output-file-tracing.md) is enabled and contain all the file paths that depend on a given page. +- `.next/server/chunks` – Shared JavaScript chunks used in multiple places throughout your application +- `.next/cache` – Output for the build cache and cached images, responses, and pages from the Next.js server. Using a cache helps decrease build times and improve performance of loading images -Congratulations! You’ve deployed your Next.js app! If you have questions, take a look at the [Vercel documentation](https://vercel.com/docs). +All JavaScript code inside `.next` has been **compiled** and browser bundles have been **minified** to help achieve the best performance and support [all modern browsers](/docs/basic-features/supported-browsers-features.md). -> If you’re using a [custom server](/docs/advanced-features/custom-server.md), we strongly recommend migrating away from it (for example, by using [dynamic routing](/docs/routing/dynamic-routes.md)). If you cannot migrate, consider [other hosting options](#other-hosting-options). +## Managed Next.js with Vercel -### DPS: Develop, Preview, Ship +[Vercel](https://vercel.com/) is a frontend cloud platform from the creators of Next.js. It's the fastest way to deploy your managed Next.js application with zero configuration. -Let’s talk about the workflow we recommend using. [Vercel](https://vercel.com) supports what we call the **DPS** workflow: **D**evelop, **P**review, and **S**hip: +When deploying to Vercel, the platform automatically detects Next.js, runs `next build`, and optimizes the build output for you, including: -- **Develop:** Write code in Next.js. Keep the development server running and take advantage of [React Fast Refresh](https://nextjs.org/blog/next-9-4#fast-refresh). -- **Preview:** Every time you push changes to a branch on GitHub / GitLab / BitBucket, Vercel automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request, or under “Preview Deployments” on your project page on Vercel. [Learn more about it here](https://vercel.com/features/deployment-previews). -- **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `main`). Vercel will automatically create a production deployment. +- Persisting cached assets across deployments if unchanged +- [Immutable deployments](https://vercel.com/features/previews) with a unique URL for every commit +- [Pages](/docs/basic-features/pages.md) are automatically statically optimized, if possible +- Assets (JavaScript, CSS, images, fonts) are compressed and served from a [Global Edge Network](https://vercel.com/features/infrastructure) +- [API Routes](/docs/api-routes/introduction.md) are automatically optimized as isolated [Serverless Functions](https://vercel.com/features/infrastructure) that can scale infinitely +- [Middleware](/docs/middleware.md) are automatically optimized as [Edge Functions](https://vercel.com/features/edge-functions) that have zero cold starts and boot instantly -By using the DPS workflow, in addition to doing _code reviews_, you can do _deployment previews_. Each deployment creates a unique URL that can be shared or used for integration tests. +In addition, Vercel provides features like: -### Optimized for Next.js +- Automatic performance monitoring with [Next.js Analytics](https://vercel.com/analytics) +- Automatic HTTPS and SSL certificates +- Automatic CI/CD (through GitHub, GitLab, Bitbucket, etc.) +- Support for [Environment Variables](https://vercel.com/docs/environment-variables) +- Support for [Custom Domains](https://vercel.com/docs/custom-domains) +- Support for [Image Optimization](/docs/basic-features/image-optimization.md) with `next/image` +- Instant global deployments via `git push` -[Vercel](https://vercel.com) is made by the creators of Next.js and has first-class support for Next.js. +You can start using Vercel (for free) through a personal hobby account, or create a team to start the next big thing. Learn more about [Next.js on Vercel](https://vercel.com/solutions/nextjs) or read the [Vercel Documentation](https://vercel.com/docs). -For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully supported out of the box. +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world&utm_source=github.com&utm_medium=referral&utm_campaign=deployment) -- Every page can either use [Static Generation](/docs/basic-features/pages.md#static-generation) or [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering). -- Pages that use [Static Generation](/docs/basic-features/pages.md#static-generation) and assets (JS, CSS, images, fonts, etc) will automatically be served from [Vercel's Edge Network](https://vercel.com/docs/edge-network/overview), which is blazingly fast. -- Pages that use [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering) and [API routes](/docs/api-routes/introduction.md) will automatically become isolated Serverless Functions. This allows page rendering and API requests to scale infinitely. +## Self-Hosting -### Custom Domains, Environment Variables, Automatic HTTPS, and more - -- **Custom Domains:** Once deployed on [Vercel](https://vercel.com), you can assign a custom domain to your Next.js app. Take a look at [our documentation here](https://vercel.com/docs/custom-domains). -- **Environment Variables:** You can also set environment variables on Vercel. Take a look at [our documentation here](https://vercel.com/docs/environment-variables). You can then [use those environment variables](/docs/api-reference/next.config.js/environment-variables.md) in your Next.js app. -- **Automatic HTTPS:** HTTPS is enabled by default (including custom domains) and doesn't require extra configuration. We auto-renew SSL certificates. -- **More:** [Read our documentation](https://vercel.com/docs) to learn more about the Vercel platform. - -## Automatic Updates - -When you deploy your Next.js application, you want to see the latest version without needing to reload. - -Next.js will automatically load the latest version of your application in the background when routing. For client-side navigation, `next/link` will temporarily function as a normal `` tag. - -**Note:** If a new page (with an old version) has already been prefetched by `next/link`, Next.js will use the old version. Then, after either a full page refresh or multiple client-side page transitions, Next.js will show the latest version. - -## Other hosting options +You can self-host Next.js with support for all features using Node.js or Docker. You can also do a Static HTML Export, which [has some limitations](/docs/advanced-features/static-html-export.md). ### Node.js Server -Next.js can be deployed to any hosting provider that supports Node.js. Make sure your `package.json` has the `"build"` and `"start"` scripts: +Next.js can be deployed to any hosting provider that supports Node.js. For example, [AWS EC2](https://aws.amazon.com/ec2/) or a [DigitalOcean Droplet](https://www.digitalocean.com/products/droplets/). + +First, ensure your `package.json` has the `"build"` and `"start"` scripts: ```json { @@ -74,73 +73,38 @@ Next.js can be deployed to any hosting provider that supports Node.js. Make sure } ``` -`next build` builds the production application in the `.next` folder. After building, `next start` starts a Node.js server that supports [hybrid pages](/docs/basic-features/pages.md), serving both statically generated and server-side rendered pages. +Then, run `next build` to build your application. Finally, run `next start` to start the Node.js server. This server supports all features of Next.js. -If you are using [`next/image`](/docs/basic-features/image-optimization.md), consider adding `sharp` for more performant [Image Optimization](/docs/basic-features/image-optimization.md) in your production environment by running `npm install sharp` in your project directory. On Linux platforms, `sharp` may require [additional configuration](https://sharp.pixelplumbing.com/install#linux-memory-allocator) to prevent excessive memory usage. +> If you are using [`next/image`](/docs/basic-features/image-optimization.md), consider adding `sharp` for more performant [Image Optimization](/docs/basic-features/image-optimization.md) in your production environment by running `npm install sharp` in your project directory. On Linux platforms, `sharp` may require [additional configuration](https://sharp.pixelplumbing.com/install#linux-memory-allocator) to prevent excessive memory usage. ### Docker Image -
- Examples - -
- Next.js can be deployed to any hosting provider that supports [Docker](https://www.docker.com/) containers. You can use this approach when deploying to container orchestrators such as [Kubernetes](https://kubernetes.io/) or [HashiCorp Nomad](https://www.nomadproject.io/), or when running inside a single node in any cloud provider. -Here is a multi-stage `Dockerfile` using `node:alpine` that you can use: - -```Dockerfile -# Install dependencies only when needed -FROM node:alpine AS deps -# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. -RUN apk add --no-cache libc6-compat -WORKDIR /app -COPY package.json yarn.lock ./ -RUN yarn install --frozen-lockfile +1. [Install Docker](https://docs.docker.com/get-docker/) on your machine +1. Clone the [with-docker](https://github.com/vercel/next.js/tree/canary/examples/with-docker) example +1. Build your container: `docker build -t nextjs-docker .` +1. Run your container: `docker run -p 3000:3000 nextjs-docker` -# Rebuild the source code only when needed -FROM node:alpine AS builder -WORKDIR /app -COPY . . -COPY --from=deps /app/node_modules ./node_modules -RUN yarn build && yarn install --production --ignore-scripts --prefer-offline - -# Production image, copy all the files and run next -FROM node:alpine AS runner -WORKDIR /app - -ENV NODE_ENV production - -RUN addgroup -g 1001 -S nodejs -RUN adduser -S nextjs -u 1001 - -# You only need to copy next.config.js if you are NOT using the default configuration -# COPY --from=builder /app/next.config.js ./ -COPY --from=builder /app/public ./public -COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next -COPY --from=builder /app/node_modules ./node_modules -COPY --from=builder /app/package.json ./package.json - -USER nextjs +### Static HTML Export -EXPOSE 3000 +If you’d like to do a static HTML export of your Next.js app, follow the directions on our [Static HTML Export documentation](/docs/advanced-features/static-html-export.md). -ENV PORT 3000 +## Automatic Updates -# Next.js collects completely anonymous telemetry data about general usage. -# Learn more here: https://nextjs.org/telemetry -# Uncomment the following line in case you want to disable telemetry. -# ENV NEXT_TELEMETRY_DISABLED 1 +When you deploy your Next.js application, you want to see the latest version without needing to reload. -CMD ["node_modules/.bin/next", "start"] -``` +Next.js will automatically load the latest version of your application in the background when routing. For client-side navigations, `next/link` will temporarily function as a normal `` tag. -Make sure to place this Dockerfile in the root folder of your project. +**Note:** If a new page (with an old version) has already been prefetched by `next/link`, Next.js will use the old version. Navigating to a page that has _not_ been prefetched (and is not cached at the CDN level) will load the latest version. -You can build your container with `docker build . -t my-next-js-app` and run it with `docker run -p 3000:3000 my-next-js-app`. +## Related -### Static HTML Export +For more information on what to do next, we recommend the following sections: -If you’d like to do a static HTML export of your Next.js app, follow the directions on [our documentation](/docs/advanced-features/static-html-export.md). + diff --git a/errors/template.md b/errors/template.txt similarity index 92% rename from errors/template.md rename to errors/template.txt index 711da0c52abf2b1..3aa3e131acac519 100644 --- a/errors/template.md +++ b/errors/template.txt @@ -1,4 +1,4 @@ -# +# {{title}} #### Why This Error Occurred diff --git a/examples/cms-contentful/README.md b/examples/cms-contentful/README.md index 40ed9286d90e912..d091e06272162f7 100644 --- a/examples/cms-contentful/README.md +++ b/examples/cms-contentful/README.md @@ -140,7 +140,7 @@ After setting up the content model (either manually or by running `npm run setup **Content model overview** -![Content model overview](./docs/content-model-overview.jpg) +![Content model overview](./docs/content-model-overview.png) ### Step 4. Populate Content @@ -159,7 +159,7 @@ Next, create another entry with the content type **Post**: **Important:** For each entry and asset, you need to click on **Publish**. If not, the entry will be in draft state. -![Published content entry](./docs/content-entry-publish.jpg) +![Published content entry](./docs/content-entry-publish.png) ### Step 5. Set up environment variables @@ -213,7 +213,7 @@ http://localhost:3000/api/preview?secret=&slug={entry Replace `` with its respective value in `.env.local`. -![Content preview setup](./docs/content-preview-setup.jpg) +![Content preview setup](./docs/content-preview-setup.png) Once saved, go to one of the posts you've created and: @@ -221,7 +221,7 @@ Once saved, go to one of the posts you've created and: - The state of the post will switch to **CHANGED** automatically. **Do not** publish it. By doing this, the post will be in draft state. - In the sidebar, you will see the **Open preview** button. Click on it! -![Content entry overview](./docs/content-entry-preview.jpg) +![Content entry overview](./docs/content-entry-preview.png) You will now be able to see the updated title. To exit preview mode, you can click on **Click here to exit preview mode** at the top of the page. diff --git a/examples/cms-contentful/components/post-body.js b/examples/cms-contentful/components/post-body.js index 88ec1b0b4e2df16..c30f9f67b30cdb1 100644 --- a/examples/cms-contentful/components/post-body.js +++ b/examples/cms-contentful/components/post-body.js @@ -1,11 +1,27 @@ import { documentToReactComponents } from '@contentful/rich-text-react-renderer' +import { BLOCKS } from '@contentful/rich-text-types' import markdownStyles from './markdown-styles.module.css' +import RichTextAsset from './rich-text-asset' + +const customMarkdownOptions = (content) => ({ + renderNode: { + [BLOCKS.EMBEDDED_ASSET]: (node) => ( + + ), + }, +}) export default function PostBody({ content }) { return (
- {documentToReactComponents(content.json)} + {documentToReactComponents( + content.json, + customMarkdownOptions(content) + )}
) diff --git a/examples/cms-contentful/components/rich-text-asset.js b/examples/cms-contentful/components/rich-text-asset.js new file mode 100644 index 000000000000000..96f593fa5c6843f --- /dev/null +++ b/examples/cms-contentful/components/rich-text-asset.js @@ -0,0 +1,11 @@ +import Image from 'next/image' + +export default function RichTextAsset({ id, assets }) { + const asset = assets?.find((asset) => asset.sys.id === id) + + if (asset?.url) { + return {asset.description} + } + + return null +} diff --git a/examples/cms-contentful/docs/content-entry-preview.jpg b/examples/cms-contentful/docs/content-entry-preview.jpg deleted file mode 100644 index d4fa3e0c55aec66..000000000000000 Binary files a/examples/cms-contentful/docs/content-entry-preview.jpg and /dev/null differ diff --git a/examples/cms-contentful/docs/content-entry-preview.png b/examples/cms-contentful/docs/content-entry-preview.png new file mode 100644 index 000000000000000..b8bb84514892eaa Binary files /dev/null and b/examples/cms-contentful/docs/content-entry-preview.png differ diff --git a/examples/cms-contentful/docs/content-entry-publish.jpg b/examples/cms-contentful/docs/content-entry-publish.jpg deleted file mode 100644 index 22858eb44c1da3c..000000000000000 Binary files a/examples/cms-contentful/docs/content-entry-publish.jpg and /dev/null differ diff --git a/examples/cms-contentful/docs/content-entry-publish.png b/examples/cms-contentful/docs/content-entry-publish.png new file mode 100644 index 000000000000000..933277d56536286 Binary files /dev/null and b/examples/cms-contentful/docs/content-entry-publish.png differ diff --git a/examples/cms-contentful/docs/content-model-overview.jpg b/examples/cms-contentful/docs/content-model-overview.jpg deleted file mode 100644 index 39c3aba63e3e417..000000000000000 Binary files a/examples/cms-contentful/docs/content-model-overview.jpg and /dev/null differ diff --git a/examples/cms-contentful/docs/content-model-overview.png b/examples/cms-contentful/docs/content-model-overview.png new file mode 100644 index 000000000000000..a1ac324b6d5a6e6 Binary files /dev/null and b/examples/cms-contentful/docs/content-model-overview.png differ diff --git a/examples/cms-contentful/docs/content-preview-setup.jpg b/examples/cms-contentful/docs/content-preview-setup.jpg deleted file mode 100644 index 23d763d6486c17c..000000000000000 Binary files a/examples/cms-contentful/docs/content-preview-setup.jpg and /dev/null differ diff --git a/examples/cms-contentful/docs/content-preview-setup.png b/examples/cms-contentful/docs/content-preview-setup.png new file mode 100644 index 000000000000000..45fee3548b0c3c9 Binary files /dev/null and b/examples/cms-contentful/docs/content-preview-setup.png differ diff --git a/examples/cms-contentful/lib/api.js b/examples/cms-contentful/lib/api.js index 077bdf1b2f71672..05359f27a61f625 100644 --- a/examples/cms-contentful/lib/api.js +++ b/examples/cms-contentful/lib/api.js @@ -14,6 +14,17 @@ author { excerpt content { json + links { + assets { + block { + sys { + id + } + url + description + } + } + } } ` diff --git a/examples/cms-contentful/package.json b/examples/cms-contentful/package.json index 91d94cac22e705c..e712efd3d7a732f 100644 --- a/examples/cms-contentful/package.json +++ b/examples/cms-contentful/package.json @@ -9,7 +9,7 @@ "dependencies": { "@contentful/rich-text-react-renderer": "^15.4.0", "classnames": "2.3.1", - "date-fns": "2.22.1", + "date-fns": "2.28.0", "next": "latest", "react": "^17.0.2", "react-dom": "^17.0.2" diff --git a/examples/with-next-translate/locales/ar/home.json b/examples/with-next-translate/locales/ar/home.json index 4543b416dda30dd..bfed894f65e73a9 100644 --- a/examples/with-next-translate/locales/ar/home.json +++ b/examples/with-next-translate/locales/ar/home.json @@ -1,10 +1,7 @@ { "arabic": "العربية", "catalan": "الكاتالونية", - "change-arabic": "تغيير اللغة إلى العربية ", - "change-catalan": "تغيير اللغة إلى الكتالانية", - "change-english": "تغيير اللغة إلى اللغة الإنجليزية ", - "change-hebrew": "تغيير اللغة إلى العبرية", + "change-to": "تغيير اللغة إلى", "description": "ابدأ بالتعديل", "english": "الإنجليزية", "hebrew": "العبرية", diff --git a/examples/with-next-translate/locales/ca/home.json b/examples/with-next-translate/locales/ca/home.json index f7ec8cf75f40100..fc59aa86063900e 100644 --- a/examples/with-next-translate/locales/ca/home.json +++ b/examples/with-next-translate/locales/ca/home.json @@ -1,10 +1,7 @@ { "arabic": "Àrab", "catalan": "Català", - "change-arabic": "Canvia a la versió en àrab", - "change-catalan": "Canvia a la versió en català", - "change-english": "Canvia a la versió en anglès", - "change-hebrew": "Canvieu a la versió hebrea", + "change-to": "Canvieu a la versió en", "description": "Comença editant", "english": "Anglès", "hebrew": "Hebreu", diff --git a/examples/with-next-translate/locales/en/home.json b/examples/with-next-translate/locales/en/home.json index 264dd02f23d99fc..83813a7c7853ae6 100644 --- a/examples/with-next-translate/locales/en/home.json +++ b/examples/with-next-translate/locales/en/home.json @@ -1,10 +1,7 @@ { "arabic": "Arabic", "catalan": "Catalan", - "change-arabic": "Change language to Arabic", - "change-catalan": "Change language to Catalan", - "change-english": "Change language to English", - "change-hebrew": "Change language to Hebrew", + "change-to": "Change language to", "description": "Get started by editing", "english": "English", "hebrew": "Hebrew", diff --git a/examples/with-next-translate/locales/he/home.json b/examples/with-next-translate/locales/he/home.json index 3b5a275c66a261b..03be1023c97dab1 100644 --- a/examples/with-next-translate/locales/he/home.json +++ b/examples/with-next-translate/locales/he/home.json @@ -1,10 +1,7 @@ { "arabic": "עֲרָבִית", "catalan": "קטלאנית", - "change-arabic": "שנה שפה לערבית", - "change-catalan": "שנה שפה לקטלונית", - "change-english": "שנה שפה לאנגלית", - "change-hebrew": "שנה את השפה לעברית", + "change-to": "שנה את השפה ל", "description": "התחל על ידי עריכה", "english": "אנגלית", "hebrew": "עִברִית", diff --git a/examples/with-next-translate/pages/index.js b/examples/with-next-translate/pages/index.js index ed065164e734d30..515026bf8572b2e 100644 --- a/examples/with-next-translate/pages/index.js +++ b/examples/with-next-translate/pages/index.js @@ -27,28 +27,36 @@ export default function Home() {

{t('home:english')}

-

{t('home:change-english')}

+

+ {t('home:change-to')} {t('home:english')} +

{t('home:catalan')}

-

{t('home:change-catalan')}

+

+ {t('home:change-to')} {t('home:catalan')} +

{t('home:arabic')}

-

{t('home:change-arabic')}

+

+ {t('home:change-to')} {t('home:arabic')} +

{t('home:hebrew')}

-

{t('home:change-hebrew')}

+

+ {t('home:change-to')} {t('home:hebrew')} +

diff --git a/examples/with-tailwindcss/.eslintrc.json b/examples/with-tailwindcss/.eslintrc.json deleted file mode 100644 index bffb357a7122523..000000000000000 --- a/examples/with-tailwindcss/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "next/core-web-vitals" -} diff --git a/examples/with-tailwindcss/README.md b/examples/with-tailwindcss/README.md index dc54d0c3f47ed64..5981eee944757cc 100644 --- a/examples/with-tailwindcss/README.md +++ b/examples/with-tailwindcss/README.md @@ -1,11 +1,3 @@ -

- -Next.js TypeScript Starter - -

- -
- # Next.js + Tailwind CSS Example This example shows how to use [Tailwind CSS](https://tailwindcss.com/) [(v3.0)](https://tailwindcss.com/blog/tailwindcss-v3) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs). diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 777749724d8720e..f8ca9a115331409 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -14,8 +14,6 @@ "@types/node": "17.0.4", "@types/react": "17.0.38", "autoprefixer": "^10.4.0", - "eslint": "8.5.0", - "eslint-config-next": "12.0.7", "postcss": "^8.4.5", "tailwindcss": "^3.0.7", "typescript": "4.5.4" diff --git a/lerna.json b/lerna.json index f975ce5a8ff8f84..fe8305ff972b9dd 100644 --- a/lerna.json +++ b/lerna.json @@ -17,5 +17,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "12.0.8-canary.17" + "version": "12.0.8-canary.20" } diff --git a/package.json b/package.json index 1d2b13d141d41f6..14127fa457211a1 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "packages/*" ], "scripts": { + "new-error": "plop error", + "new-test": "plop test", "clean": "yarn lerna clean -y && yarn lerna bootstrap && yarn lerna exec 'rm -rf ./dist'", "build": "yarn prepublish", "lerna": "lerna", @@ -128,6 +130,7 @@ "nprogress": "0.2.0", "pixrem": "5.0.0", "playwright-chromium": "1.14.1", + "plop": "3.0.5", "postcss-nested": "4.2.1", "postcss-pseudoelements": "5.0.0", "postcss-short-size": "4.0.0", diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index a095e220fc01396..70a0929f77458f9 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "keywords": [ "react", "next", diff --git a/packages/create-next-app/templates/typescript/next.config.js b/packages/create-next-app/templates/typescript/next.config.js index 8b61df4e50f8a8a..a843cbee09afaad 100644 --- a/packages/create-next-app/templates/typescript/next.config.js +++ b/packages/create-next-app/templates/typescript/next.config.js @@ -1,4 +1,6 @@ /** @type {import('next').NextConfig} */ -module.exports = { +const nextConfig = { reactStrictMode: true, } + +module.exports = nextConfig diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index 97a558e6f4a10e5..7a9b9a5fb00158f 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "description": "ESLint configuration used by NextJS.", "main": "index.js", "license": "MIT", @@ -9,7 +9,7 @@ "directory": "packages/eslint-config-next" }, "dependencies": { - "@next/eslint-plugin-next": "12.0.8-canary.17", + "@next/eslint-plugin-next": "12.0.8-canary.20", "@rushstack/eslint-patch": "^1.0.8", "@typescript-eslint/parser": "^5.0.0", "eslint-import-resolver-node": "^0.3.4", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index c25236678930aa5..b78d53bf38fd76e 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "description": "ESLint plugin for NextJS.", "main": "lib/index.js", "license": "MIT", diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 9f0b2fcb47532c5..73ae63b55e0ab11 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index f4d5bbf559895ca..335d20275d7e96e 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "license": "MIT", "dependencies": { "chalk": "4.1.0", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index 261cf3779041589..a1588be372c5a68 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 10a51f853ae26ed..9f294239f1d80f7 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 7792749f169c608..98725679a5e414b 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index 34924c34e3f155a..210c1a630bc0285 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index c7a2fc585bc0f9a..b4a88194934a6f0 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next-swc/Cargo.lock b/packages/next-swc/Cargo.lock index be5d3b9a2b9da89..69e5bb882a8f612 100644 --- a/packages/next-swc/Cargo.lock +++ b/packages/next-swc/Cargo.lock @@ -69,11 +69,17 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + [[package]] name = "ast_node" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96d5444b02f3080edac8a144f6baf29b2fb6ff589ad4311559731a7c7529381" +checksum = "82b2dd56b7c509b3a0bb47a97a066cba459983470d3b8a3c20428737270f70bd" dependencies = [ "darling", "pmutil", @@ -94,18 +100,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "auto_impl" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cbf586c80ada5e5ccdecae80d3ef0854f224e2dd74435f8d87e6831b8d0a38" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "auto_impl" version = "0.5.0" @@ -118,12 +112,6 @@ dependencies = [ "syn", ] -[[package]] -name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - [[package]] name = "autocfg" version = "1.0.1" @@ -174,9 +162,9 @@ dependencies = [ [[package]] name = "browserslist-rs" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e8d671fb6bc653acdcfbdb1b30ac1117df4cf9bb6a0a813668c8ea49f58622" +checksum = "31071741816efb54c473a6480724b2d31ed44eb460382d37f60cf4655fbe80a6" dependencies = [ "ahash", "anyhow", @@ -186,11 +174,13 @@ dependencies = [ "js-sys", "nom", "once_cell", + "quote", "serde", "serde-wasm-bindgen", "serde_json", + "string_cache", + "string_cache_codegen", "thiserror", - "ustr", "wasm-bindgen", ] @@ -245,15 +235,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - [[package]] name = "cloudabi" version = "0.1.0" @@ -322,7 +303,7 @@ dependencies = [ "crossbeam-utils", "lazy_static", "memoffset", - "scopeguard 1.1.0", + "scopeguard", ] [[package]] @@ -484,12 +465,6 @@ dependencies = [ "syn", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "fxhash" version = "0.2.1" @@ -596,7 +571,7 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ - "autocfg 1.0.1", + "autocfg", "hashbrown", "rayon", "serde", @@ -670,7 +645,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ - "arrayvec", + "arrayvec 0.5.2", "bitflags", "cfg-if 1.0.0", "ryu", @@ -683,23 +658,13 @@ version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119" -[[package]] -name = "lock_api" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" -dependencies = [ - "owning_ref", - "scopeguard 0.3.3", -] - [[package]] name = "lock_api" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" dependencies = [ - "scopeguard 1.1.0", + "scopeguard", ] [[package]] @@ -713,18 +678,18 @@ dependencies = [ [[package]] name = "lru" -version = "0.6.6" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" +checksum = "274353858935c992b13c0ca408752e2121da852d07dec7ce5f108c77dfa14d1f" dependencies = [ "hashbrown", ] [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata", ] @@ -735,12 +700,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "memchr" version = "2.4.1" @@ -753,7 +712,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" dependencies = [ - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -789,7 +748,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -852,7 +811,7 @@ dependencies = [ "swc_css", "swc_ecma_loader", "swc_ecma_transforms_testing", - "swc_ecmascript 0.98.0", + "swc_ecmascript", "swc_node_base", "swc_stylis", "testing", @@ -879,7 +838,7 @@ dependencies = [ "swc_bundler", "swc_common", "swc_ecma_loader", - "swc_ecmascript 0.98.0", + "swc_ecmascript", "swc_node_base", ] @@ -909,7 +868,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.0.1", + "autocfg", "num-integer", "num-traits", "serde", @@ -921,7 +880,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.1", + "autocfg", "num-traits", ] @@ -931,7 +890,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -992,16 +951,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "parking_lot" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" -dependencies = [ - "lock_api 0.1.5", - "parking_lot_core 0.4.0", -] - [[package]] name = "parking_lot" version = "0.11.1" @@ -1009,21 +958,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.5", - "parking_lot_core 0.8.0", -] - -[[package]] -name = "parking_lot_core" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" -dependencies = [ - "libc", - "rand 0.6.5", - "rustc_version", - "smallvec 0.6.14", - "winapi", + "lock_api", + "parking_lot_core", ] [[package]] @@ -1033,11 +969,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ "cfg-if 0.1.10", - "cloudabi 0.1.0", + "cloudabi", "instant", "libc", "redox_syscall 0.1.57", - "smallvec 1.7.0", + "smallvec", "winapi", ] @@ -1208,25 +1144,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce082a9940a7ace2ad4a8b7d0b1eac6aa378895f18be598230c5f2284ac05426" -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg 0.1.2", - "rand_xorshift", - "winapi", -] - [[package]] name = "rand" version = "0.7.3" @@ -1238,7 +1155,7 @@ dependencies = [ "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc 0.2.0", - "rand_pcg 0.2.1", + "rand_pcg", ] [[package]] @@ -1253,16 +1170,6 @@ dependencies = [ "rand_hc 0.3.1", ] -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", -] - [[package]] name = "rand_chacha" version = "0.2.2" @@ -1283,21 +1190,6 @@ dependencies = [ "rand_core 0.6.3", ] -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" @@ -1316,15 +1208,6 @@ dependencies = [ "getrandom 0.2.3", ] -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -1343,50 +1226,6 @@ dependencies = [ "rand_core 0.6.3", ] -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi 0.0.3", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - [[package]] name = "rand_pcg" version = "0.2.1" @@ -1396,22 +1235,13 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rayon" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ - "autocfg 1.0.1", + "autocfg", "crossbeam-deque", "either", "rayon-core", @@ -1430,15 +1260,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.1.57" @@ -1519,7 +1340,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver", + "semver 0.9.0", ] [[package]] @@ -1543,12 +1364,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" -[[package]] -name = "scopeguard" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" - [[package]] name = "scopeguard" version = "1.1.0" @@ -1562,6 +1377,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +dependencies = [ "serde", ] @@ -1573,9 +1396,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.130" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a" dependencies = [ "serde_derive", ] @@ -1594,9 +1417,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" dependencies = [ "proc-macro2", "quote", @@ -1652,15 +1475,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "533494a8f9b724d33625ab53c6c4800f7cc445895924a8ef649222dcb76e938b" -[[package]] -name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - [[package]] name = "smallvec" version = "1.7.0" @@ -1689,7 +1503,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3caeb13a58f859600a7b75fffe66322e1fca0122ca02cfc7262344a7e30502d1" dependencies = [ - "arrayvec", + "arrayvec 0.5.2", "static-map-macro", ] @@ -1725,7 +1539,7 @@ checksum = "923f0f39b6267d37d23ce71ae7235602134b250ace715dd2c90421998ddac0c6" dependencies = [ "lazy_static", "new_debug_unreachable", - "parking_lot 0.11.1", + "parking_lot", "phf_shared", "precomputed-hash", "serde", @@ -1764,9 +1578,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "styled_components" -version = "0.6.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17c1f6d12f80d3d987c92f8119ad881d9a32a26c39fe1217746307b9836e74b" +checksum = "03481b5475b58a779b5a01a1a4d73af4cd4a558293a8f63013dc13ded66858ad" dependencies = [ "Inflector", "once_cell", @@ -1774,15 +1588,15 @@ dependencies = [ "serde", "swc_atoms", "swc_common", - "swc_ecmascript 0.97.0", + "swc_ecmascript", "tracing", ] [[package]] name = "swc" -version = "0.98.0" +version = "0.110.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97b0e03ffd79b2a591c8f3e45d62b43cf658b4fdd3f2ececa25f190c041be1a" +checksum = "28fbf5ca7965aa18b1da211c28ad9b0e7c27c9b4fdcaa5f0f462d838a300bd20" dependencies = [ "ahash", "anyhow", @@ -1813,7 +1627,7 @@ dependencies = [ "swc_ecma_transforms_optimization", "swc_ecma_utils", "swc_ecma_visit", - "swc_ecmascript 0.98.0", + "swc_ecmascript", "swc_node_comments", "swc_visit", "tracing", @@ -1831,9 +1645,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.91.0" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40272a8efb0bdb7b001677d4efbb65b2dfb2386545687d7839ab5999d2407da" +checksum = "0c259a985448bbb72521da3a4fdbe664980e055a422214fe871a428fb7091068" dependencies = [ "ahash", "anyhow", @@ -1842,7 +1656,7 @@ dependencies = [ "indexmap", "is-macro", "once_cell", - "parking_lot 0.11.1", + "parking_lot", "petgraph", "radix_fmt", "rayon", @@ -1865,9 +1679,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.15.1" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf33ac965b9ce43b653baa35a5de6ecfd96b9bbab9547a5fb4ce33c46a36fe75" +checksum = "df9aa1afd061fdc6e73c8dd0a0cd3bc4c36f1e40e61427a7033f2e9b70ce2269" dependencies = [ "ahash", "ast_node", @@ -1879,7 +1693,7 @@ dependencies = [ "num-bigint", "once_cell", "owning_ref", - "parking_lot 0.7.1", + "parking_lot", "rustc-hash", "scoped-tls", "serde", @@ -1895,9 +1709,9 @@ dependencies = [ [[package]] name = "swc_css" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8a884ef7656268711992a8ff9c210ca10d8b9805d49ee76c3064fe36d54cd8" +checksum = "3e34ca99200f5b09af8ce689f75a568dd07cdb1719b4e78c5d844ae1f96790bf" dependencies = [ "swc_css_ast", "swc_css_codegen", @@ -1908,9 +1722,9 @@ dependencies = [ [[package]] name = "swc_css_ast" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45ea4319216278b889edb38feefdc6174f0b7f4e76412dd1b64c796d2a1ae98" +checksum = "3d09734736a9b06e9fd3ab9c63c3edc7c5439d5ad74212feb250bd6e66ddf41c" dependencies = [ "is-macro", "serde", @@ -1921,11 +1735,11 @@ dependencies = [ [[package]] name = "swc_css_codegen" -version = "0.42.1" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa9cc8b1c68320e0fd7df1b6d0f2d71e4429fd207c1ab95a84f3f4021fb6886" +checksum = "d9d1dcb76300069a43fa9dbb88b6582e75fafb9d21252983e273839932359a33" dependencies = [ - "auto_impl 0.4.1", + "auto_impl", "bitflags", "swc_atoms", "swc_common", @@ -1948,23 +1762,22 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "0.44.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75f4add57624662c408f1fe61a8a14522a16dce24d5114885652701b6921f4f" +checksum = "fd34959a0fdb90445abf51d6669840d9344ab9d1766703259cb45e1c462384bb" dependencies = [ "bitflags", "lexical", "swc_atoms", "swc_common", "swc_css_ast", - "unicode-xid", ] [[package]] name = "swc_css_utils" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68fa86c5475fab73ec9648823149d1e3735ef847a5fbf015043eb2be67a59ca" +checksum = "824eeca37d946b192d754b5527ee14ab5d3b65faa1e9e6c6426420ff17ae64f2" dependencies = [ "swc_atoms", "swc_common", @@ -1974,9 +1787,9 @@ dependencies = [ [[package]] name = "swc_css_visit" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba4976df9cb8aebba40624620295cec44ddbd66aca90ac0ea27a59cf89312be" +checksum = "1b6005fda07744627afc7f96801856eeb2bcfba4a1e369bfa1439d40f7b37848" dependencies = [ "swc_atoms", "swc_common", @@ -1986,9 +1799,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.60.0" +version = "0.63.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052740f42852b75e3ed8a38e950e4a473dc29f1e7b618af6d57ec893ab5f547e" +checksum = "79606092f73c188dfd4897cc63ff613c6967fd5f822cb407d2b6b96d4093b211" dependencies = [ "is-macro", "num-bigint", @@ -1996,13 +1809,14 @@ dependencies = [ "string_enum", "swc_atoms", "swc_common", + "unicode-xid", ] [[package]] name = "swc_ecma_codegen" -version = "0.84.0" +version = "0.87.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc10b3a2fb8bdfcb9cf0bcf32febd5b9c4217ca1f0ca24da985d7c376b4a88e1" +checksum = "661dcec97d229f6bca1ea4d28e88364ff3512142afeb05e467cfc925a724937c" dependencies = [ "bitflags", "memchr", @@ -2032,27 +1846,26 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "0.42.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d80651f459a5b0c0b01cf1ebdf59d13ec3bfb58e0a5f0db7210f23f4384abf29" +checksum = "f22be85d48703ed980e523bfcf0cf60fdd59386470b9a2e6fdb3f01e72922ac1" dependencies = [ "phf", "swc_atoms", "swc_common", "swc_ecma_ast", - "swc_ecma_parser", "swc_ecma_utils", "swc_ecma_visit", ] [[package]] name = "swc_ecma_lints" -version = "0.1.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8df880a33963e3c8cacc7cfe5a18943cbaf8b60302db2495fce74b2588fe36" +checksum = "6569b03f6232db62f3520e6344d33a13c18b3bca356eca9137ad1c6087b54b62" dependencies = [ - "auto_impl 0.5.0", - "parking_lot 0.11.1", + "auto_impl", + "parking_lot", "rayon", "swc_atoms", "swc_common", @@ -2063,9 +1876,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c9672f7cf71bf2a98fc0c66eed90d43db9252c82e52096c7159ea5521f3478" +checksum = "61e4a236d9fc809d88e8d346381e72936dc8a4e4a2418d1f66ea8acb6ed298be" dependencies = [ "ahash", "anyhow", @@ -2077,16 +1890,15 @@ dependencies = [ "regex", "serde", "serde_json", - "swc_atoms", "swc_common", "tracing", ] [[package]] name = "swc_ecma_minifier" -version = "0.60.0" +version = "0.65.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff12d60cc73b62ee122f7947404367617abd8e07328b16defc93175efdee898e" +checksum = "c20d75221fe940ed8ffeae15d591a28bfa87ea64ab1bb5f09ed791e66f044604" dependencies = [ "ahash", "indexmap", @@ -2106,22 +1918,23 @@ dependencies = [ "swc_ecma_transforms_base", "swc_ecma_utils", "swc_ecma_visit", + "swc_timer", "tracing", "unicode-xid", ] [[package]] name = "swc_ecma_parser" -version = "0.82.2" +version = "0.85.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0972f5b73547d3e76226ead735e5b17c4a874c5f2a77f6f45dc085e36a61ab7c" +checksum = "a61cbbfd77c475564b745ad782e177d3c5ee3503308150eed78fc264f40809f1" dependencies = [ "either", "enum_kind", "lexical", "num-bigint", "serde", - "smallvec 1.7.0", + "smallvec", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -2132,9 +1945,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.76.0" +version = "0.81.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd310ad100df8eecb3c1856b14a663ba712e4e27fe96ff9577e6be4ffd5aac10" +checksum = "aa0b09466dbea47b04178cfd0262999c2a9cebe67e6fb8869c7267ac166f7daa" dependencies = [ "ahash", "anyhow", @@ -2142,7 +1955,7 @@ dependencies = [ "dashmap", "indexmap", "once_cell", - "semver", + "semver 1.0.4", "serde", "serde_json", "st-map", @@ -2158,9 +1971,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.103.0" +version = "0.108.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36caebdc49957eb75d1f8a37d98a67391b1d6d8e2c0cab72743772009ed602fb" +checksum = "693c0fc3090c7a4dd3fcea703b58bb3b7e12eb75c1b561ed185dd4359db3e78c" dependencies = [ "swc_atoms", "swc_common", @@ -2180,15 +1993,16 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.49.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afc842a0b89b27bd2c6c202d7c36254f30f286c3388a44890497881bdcc9fe5" +checksum = "e53a60add62a482d233e666ac14756251f7559fef66671e345ad935f2e18cc71" dependencies = [ "once_cell", "phf", "rayon", "scoped-tls", - "smallvec 1.7.0", + "serde", + "smallvec", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -2200,9 +2014,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.36.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd931a99d9c0ce03ed265daa255ba2e6a69b9bd43f8928165df0b621938f8eaf" +checksum = "81b0cbea86bae526d5c640ee8d3cbcb7726f907277225ffcca363796a6985f19" dependencies = [ "swc_atoms", "swc_common", @@ -2214,18 +2028,18 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.59.0" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa65b9e52fb11d3237e38dce4326628683728bd34b10d88d4b618e36cf754b44" +checksum = "712770f8f1fc14e632b5f96a2b2f1d1d9fe037c669cbd62a7990c23d7e55a13a" dependencies = [ "ahash", - "arrayvec", + "arrayvec 0.7.2", "indexmap", "is-macro", "num-bigint", "ordered-float", "serde", - "smallvec 1.7.0", + "smallvec", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -2252,9 +2066,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.65.0" +version = "0.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "701c941a6ba8d4e396a3e63031a9d4ee4807dc91b29c30069e88c0276a44a01e" +checksum = "83a8d5053c0b3383f3292eea14cbe3d349b98fba3249fbd12323182d6aede4e4" dependencies = [ "Inflector", "ahash", @@ -2274,16 +2088,15 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.73.0" +version = "0.78.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19b44dccd619c4e1957b989c4558cdfed6cd3934d3be07baea0ca99616046af" +checksum = "139ace7ce4991532297ff1af7b960799988cba058cb49926b4951a67a0c2fa0d" dependencies = [ "ahash", "dashmap", "indexmap", "once_cell", "rayon", - "retain_mut", "serde_json", "swc_atoms", "swc_common", @@ -2298,13 +2111,13 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.65.0" +version = "0.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38880cd5e15cd347c46a6bd06a561c2c8b7cfc6e0b32cca3f5cab0fdfb942420" +checksum = "c6e7e3f58a2b0ba87389826ca1a0552457f7e9cd7cc4c1d717b0addbc86fc424" dependencies = [ "either", "serde", - "smallvec 1.7.0", + "smallvec", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -2318,9 +2131,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.67.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af461db87bc2c89565bbf56210b1d08508e717fc93bbee7da7caea08b52367" +checksum = "d4d98cab103d93cfffca8938819fad7f5df4a16deb75956770ae6cbfc5b71f68" dependencies = [ "ahash", "base64 0.13.0", @@ -2343,9 +2156,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.51.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6568898909886ffd855dc97e7dfa7e562205acea0a1e8a3152e71c4f712fbf1" +checksum = "6ca6d81a864fab16bce9b86cbc921297256b6bf0f532bab621a6dbf04ecde366" dependencies = [ "ansi_term", "anyhow", @@ -2366,9 +2179,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.69.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "296307dfa569b71d00f37dcf5c34938a707bd886b5cfb117189e37c83a767c80" +checksum = "37457c86bc39bf18d54995fb7d55d68a95d2f6ebb8d00ebffdd0f2419db1220d" dependencies = [ "serde", "swc_atoms", @@ -2383,9 +2196,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.56.1" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b384378556a88a4acce00057bf048d9a72c95de4bbc6d966cf433d5d874024" +checksum = "164f22342740e5b299f215a511aefa4dbb9be3586248d05d4249c56964815197" dependencies = [ "once_cell", "rayon", @@ -2394,14 +2207,13 @@ dependencies = [ "swc_ecma_ast", "swc_ecma_visit", "tracing", - "unicode-xid", ] [[package]] name = "swc_ecma_visit" -version = "0.46.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c03856f785763e50019ebd70281e9490c5b019f93cfc1dda180d49e30fcb4c" +checksum = "e7637451decd27af9db5ded9eb4ce2c071be4df68108e1221722033c0fab3e18" dependencies = [ "num-bigint", "swc_atoms", @@ -2413,21 +2225,9 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.97.0" +version = "0.105.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ef869c364989c2aa775c80e3182df85fcd9d8c37d1117e1fe1ccc2b0127521" -dependencies = [ - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecmascript" -version = "0.98.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb250458a96ec2d8e83babb61837cb5f4f870a61a41b4a57ee6763a3ebdb700" +checksum = "67db9c61ea3694375eed4ce95a916201b37470b19dad709c84087ebe8cd20c33" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", @@ -2452,9 +2252,9 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4e08c814c7283238c72c61069614b55d58ccfeeb5e4fd9887913e9d34102632" +checksum = "4857942a9c79e9836f51dca4ca0df89f354acfedc573708006c4365bad07083c" dependencies = [ "ahash", "indexmap", @@ -2464,12 +2264,12 @@ dependencies = [ [[package]] name = "swc_graph_analyzer" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13707fe5ba172950c56e16ab206f4d2a7da4e16742e7f527c331c1e0973267d4" +checksum = "3c5f079d9350dee80a59ac2f8be9867ed0a8ac9fb0023461b173e9e42168ff30" dependencies = [ "ahash", - "auto_impl 0.5.0", + "auto_impl", "petgraph", "swc_fast_graph", "tracing", @@ -2498,9 +2298,9 @@ dependencies = [ [[package]] name = "swc_node_comments" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413c5c78a9a26b7aa5bb5b0a3e972f90c9d077e5b0adcbac74f6acda69c0ecea" +checksum = "d526bfa1fde8b608352393c404071117c89170ae1e79b2fc97283d6a4bcd3cad" dependencies = [ "ahash", "dashmap", @@ -2509,9 +2309,9 @@ dependencies = [ [[package]] name = "swc_stylis" -version = "0.41.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4de66eb78145902126ab5b366f2c87cda60310b0ebf36f263d336d07b48c3b7" +checksum = "26b09b0bdc59e26768e9e2bbcf8b1b722f0798cc0b12856f43e3e610bf4f0eb8" dependencies = [ "swc_atoms", "swc_common", @@ -2520,6 +2320,15 @@ dependencies = [ "swc_css_visit", ] +[[package]] +name = "swc_timer" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81ea392f1e84a0195aa2d06e8c445751bdb1b93a1f6b156500fbf25965679e57" +dependencies = [ + "tracing", +] + [[package]] name = "swc_visit" version = "0.3.0" @@ -2580,9 +2389,9 @@ dependencies = [ [[package]] name = "testing" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c76da55a24d7aaae035f6740bfd50e85c0b152217e4894114ce3486a781d1bc" +checksum = "5b1398e0c651977e82840793e12605221139aeadbe63cf5c3704a38934fa1656" dependencies = [ "ansi_term", "difference", @@ -2709,36 +2518,22 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +checksum = "5d81bfa81424cc98cb034b837c985b7a290f592e5b4322f353f94a0ab0f9f594" dependencies = [ "ansi_term", - "chrono", "lazy_static", "matchers", "regex", - "serde", - "serde_json", "sharded-slab", - "smallvec 1.7.0", + "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] @@ -2801,19 +2596,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "ustr" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd539d8973e229b9d04f15d36e6a8f8d8f85f946b366f06bb001aaed3fa9dd9" -dependencies = [ - "ahash", - "byteorder", - "lazy_static", - "parking_lot 0.11.1", - "serde", -] - [[package]] name = "version_check" version = "0.9.3" @@ -2857,13 +2639,13 @@ dependencies = [ "console_error_panic_hook", "next-swc", "once_cell", - "parking_lot_core 0.8.0", + "parking_lot_core", "path-clean", "serde", "serde_json", "swc", "swc_common", - "swc_ecmascript 0.98.0", + "swc_ecmascript", "tracing", "wasm-bindgen", "wasm-bindgen-futures", diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index da09227971275f6..4300161a6ee72c0 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -14,21 +14,21 @@ fxhash = "0.2.1" pathdiff = "0.2.0" serde = "1" serde_json = "1" -styled_components = "0.6.0" -swc = "0.98.0" +styled_components = "0.9.0" +swc = "0.110.0" swc_atoms = "0.2.7" -swc_common = { version = "0.15.0", features = ["concurrent", "sourcemap"] } -swc_css = "0.44.0" -swc_ecma_loader = { version = "0.25.0", features = ["node", "lru"] } -swc_ecmascript = { version = "0.98.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_common = { version = "0.16.0", features = ["concurrent", "sourcemap"] } +swc_css = "0.45.0" +swc_ecma_loader = { version = "0.26.0", features = ["node", "lru"] } +swc_ecmascript = { version = "0.105.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_node_base = "0.5.1" -swc_stylis = "0.41.1" +swc_stylis = "0.42.0" tracing = {version = "0.1.28", features = ["release_max_level_off"]} regex = "1.5" [dev-dependencies] -swc_ecma_transforms_testing = "0.51.0" -testing = "0.16.0" +swc_ecma_transforms_testing = "0.56.0" +testing = "0.17.0" walkdir = "2.3.2" diff --git a/packages/next-swc/crates/core/src/next_dynamic.rs b/packages/next-swc/crates/core/src/next_dynamic.rs index dd67b916e13bbc0..12cb475dfba54e6 100644 --- a/packages/next-swc/crates/core/src/next_dynamic.rs +++ b/packages/next-swc/crates/core/src/next_dynamic.rs @@ -4,10 +4,11 @@ use pathdiff::diff_paths; use swc_atoms::js_word; use swc_common::{FileName, DUMMY_SP}; use swc_ecmascript::ast::{ - ArrayLit, ArrowExpr, BinExpr, BinaryOp, BlockStmtOrExpr, CallExpr, Expr, ExprOrSpread, - ExprOrSuper, Ident, ImportDecl, ImportSpecifier, KeyValueProp, Lit, MemberExpr, ObjectLit, - Prop, PropName, PropOrSpread, Str, StrKind, + ArrayLit, ArrowExpr, BinExpr, BinaryOp, BlockStmtOrExpr, Bool, CallExpr, Expr, ExprOrSpread, + ExprOrSuper, Ident, ImportDecl, ImportSpecifier, KeyValueProp, Lit, MemberExpr, Null, + ObjectLit, Prop, PropName, PropOrSpread, Str, StrKind, }; +use swc_ecmascript::utils::ExprFactory; use swc_ecmascript::utils::{ ident::{Id, IdentLike}, HANDLER, @@ -236,16 +237,52 @@ impl Fold for NextDynamicPatcher { value: generated, })))]; + let mut has_ssr_false = false; + if expr.args.len() == 2 { if let Expr::Object(ObjectLit { props: options_props, .. }) = &*expr.args[1].expr { + for prop in options_props.iter() { + if let Some(KeyValueProp { key, value }) = match prop { + PropOrSpread::Prop(prop) => match &**prop { + Prop::KeyValue(key_value_prop) => Some(key_value_prop), + _ => None, + }, + _ => None, + } { + if let Some(Ident { + sym, + span: _, + optional: _, + }) = match key { + PropName::Ident(ident) => Some(ident), + _ => None, + } { + if sym == "ssr" { + if let Some(Lit::Bool(Bool { + value: false, + span: _, + })) = match &**value { + Expr::Lit(lit) => Some(lit), + _ => None, + } { + has_ssr_false = true + } + } + } + } + } props.extend(options_props.iter().cloned()); } } + if has_ssr_false && self.is_server { + expr.args[0] = Lit::Null(Null { span: DUMMY_SP }).as_arg(); + } + let second_arg = ExprOrSpread { spread: None, expr: Box::new(Expr::Object(ObjectLit { diff --git a/packages/next-swc/crates/core/src/next_ssg.rs b/packages/next-swc/crates/core/src/next_ssg.rs index 7e36c32e12bde65..5d3647c8cc10718 100644 --- a/packages/next-swc/crates/core/src/next_ssg.rs +++ b/packages/next-swc/crates/core/src/next_ssg.rs @@ -11,7 +11,7 @@ use swc_ecmascript::{ visit::{noop_fold_type, Fold}, }; -/// Note: This paths requires runnning `resolver` **before** running this. +/// Note: This paths requires running `resolver` **before** running this. pub fn next_ssg() -> impl Fold { Repeat::new(NextSsg { state: Default::default(), @@ -19,7 +19,7 @@ pub fn next_ssg() -> impl Fold { }) } -/// State of the transforms. Shared by the anayzer and the tranform. +/// State of the transforms. Shared by the analyzer and the transform. #[derive(Debug, Default)] struct State { /// Identifiers referenced by non-data function codes. @@ -45,11 +45,7 @@ struct State { impl State { fn is_data_identifier(&mut self, i: &Ident) -> Result { - let ssg_exports = &[ - "getStaticProps", - "getStaticPaths", - "getServerSideProps", - ]; + let ssg_exports = &["getStaticProps", "getStaticPaths", "getServerSideProps"]; if ssg_exports.contains(&&*i.sym) { if &*i.sym == "getServerSideProps" { @@ -125,7 +121,9 @@ impl Fold for Analyzer<'_> { } fn fold_export_named_specifier(&mut self, s: ExportNamedSpecifier) -> ExportNamedSpecifier { - self.add_ref(s.orig.to_id()); + if let ModuleExportName::Ident(id) = &s.orig { + self.add_ref(id.to_id()); + } s } @@ -143,6 +141,31 @@ impl Fold for Analyzer<'_> { e } + fn fold_jsx_element(&mut self, jsx: JSXElement) -> JSXElement { + fn get_leftmost_id_member_expr(e: &JSXMemberExpr) -> Id { + match &e.obj { + JSXObject::Ident(i) => { + i.to_id() + } + JSXObject::JSXMemberExpr(e) => { + get_leftmost_id_member_expr(e) + } + } + } + + match &jsx.opening.name { + JSXElementName::Ident(i) => { + self.add_ref(i.to_id()); + } + JSXElementName::JSXMemberExpr(e) => { + self.add_ref(get_leftmost_id_member_expr(e)); + } + _ => {} + } + + jsx.fold_children_with(self) + } + fn fold_fn_decl(&mut self, f: FnDecl) -> FnDecl { let old_in_data = self.in_data_fn; @@ -189,7 +212,7 @@ impl Fold for Analyzer<'_> { e } - /// Drops [ExportDecl] if all speicifers are removed. + /// Drops [ExportDecl] if all specifiers are removed. fn fold_module_item(&mut self, s: ModuleItem) -> ModuleItem { match s { ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(e)) if !e.specifiers.is_empty() => { @@ -211,8 +234,7 @@ impl Fold for Analyzer<'_> { ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(e)) => match &e.decl { Decl::Fn(f) => { // Drop getStaticProps. - if let Ok(is_data_identifier) = self.state.is_data_identifier(&f.ident) - { + if let Ok(is_data_identifier) = self.state.is_data_identifier(&f.ident) { if is_data_identifier { return ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP })); } @@ -493,29 +515,38 @@ impl Fold for NextSsg { n.specifiers.retain(|s| { let preserve = match s { - ExportSpecifier::Namespace(ExportNamespaceSpecifier { name: exported, .. }) + ExportSpecifier::Namespace(ExportNamespaceSpecifier { + name: ModuleExportName::Ident(exported), + .. + }) | ExportSpecifier::Default(ExportDefaultSpecifier { exported, .. }) | ExportSpecifier::Named(ExportNamedSpecifier { - exported: Some(exported), + exported: Some(ModuleExportName::Ident(exported)), .. }) => self .state .is_data_identifier(&exported) .map(|is_data_identifier| !is_data_identifier), - ExportSpecifier::Named(s) => self + ExportSpecifier::Named(ExportNamedSpecifier { + orig: ModuleExportName::Ident(orig), + .. + }) => self .state - .is_data_identifier(&s.orig) + .is_data_identifier(&orig) .map(|is_data_identifier| !is_data_identifier), + + _ => Ok(true), }; match preserve { Ok(false) => { - tracing::trace!( - "Dropping a export specifier because it's a data identifier" - ); + tracing::trace!("Dropping a export specifier because it's a data identifier"); match s { - ExportSpecifier::Named(ExportNamedSpecifier { orig, .. }) => { + ExportSpecifier::Named(ExportNamedSpecifier { + orig: ModuleExportName::Ident(orig), + .. + }) => { self.state.should_run_again = true; self.state.refs_from_data_fn.insert(orig.to_id()); } diff --git a/packages/next-swc/crates/core/src/page_config.rs b/packages/next-swc/crates/core/src/page_config.rs index cbdf7fdd2ea168f..0b214038a15f1ae 100644 --- a/packages/next-swc/crates/core/src/page_config.rs +++ b/packages/next-swc/crates/core/src/page_config.rs @@ -5,153 +5,176 @@ use swc_ecmascript::utils::HANDLER; use swc_ecmascript::visit::{Fold, FoldWith}; pub fn page_config(is_development: bool, is_page_file: bool) -> impl Fold { - PageConfig { - is_development, - is_page_file, - ..Default::default() - } + PageConfig { + is_development, + is_page_file, + ..Default::default() + } } pub fn page_config_test() -> impl Fold { - PageConfig { - in_test: true, - is_page_file: true, - ..Default::default() - } + PageConfig { + in_test: true, + is_page_file: true, + ..Default::default() + } } #[derive(Debug, Default)] struct PageConfig { - drop_bundle: bool, - in_test: bool, - is_development: bool, - is_page_file: bool, + drop_bundle: bool, + in_test: bool, + is_development: bool, + is_page_file: bool, } const STRING_LITERAL_DROP_BUNDLE: &str = "__NEXT_DROP_CLIENT_FILE__"; const CONFIG_KEY: &str = "config"; impl Fold for PageConfig { - fn fold_module_items(&mut self, items: Vec) -> Vec { - let mut new_items = vec![]; - for item in items { - new_items.push(item.fold_with(self)); - if !self.is_development && self.drop_bundle { - let timestamp = match self.in_test { - true => String::from("mock_timestamp"), - false => Utc::now().timestamp().to_string(), - }; - return vec![ModuleItem::Stmt(Stmt::Decl(Decl::Var(VarDecl { - decls: vec![VarDeclarator { - name: Pat::Ident(BindingIdent { - id: Ident { - sym: STRING_LITERAL_DROP_BUNDLE.into(), - span: DUMMY_SP, - optional: false, - }, - type_ann: None, - }), - init: Some(Box::new(Expr::Lit(Lit::Str(Str { - value: format!("{} {}", STRING_LITERAL_DROP_BUNDLE, timestamp).into(), - span: DUMMY_SP, - kind: StrKind::Synthesized {}, - has_escape: false, - })))), - span: DUMMY_SP, - definite: false, - }], - span: DUMMY_SP, - kind: VarDeclKind::Const, - declare: false, - })))]; - } - } + fn fold_module_items(&mut self, items: Vec) -> Vec { + let mut new_items = vec![]; + for item in items { + new_items.push(item.fold_with(self)); + if !self.is_development && self.drop_bundle { + let timestamp = match self.in_test { + true => String::from("mock_timestamp"), + false => Utc::now().timestamp().to_string(), + }; + return vec![ModuleItem::Stmt(Stmt::Decl(Decl::Var(VarDecl { + decls: vec![VarDeclarator { + name: Pat::Ident(BindingIdent { + id: Ident { + sym: STRING_LITERAL_DROP_BUNDLE.into(), + span: DUMMY_SP, + optional: false, + }, + type_ann: None, + }), + init: Some(Box::new(Expr::Lit(Lit::Str(Str { + value: format!("{} {}", STRING_LITERAL_DROP_BUNDLE, timestamp).into(), + span: DUMMY_SP, + kind: StrKind::Synthesized {}, + has_escape: false, + })))), + span: DUMMY_SP, + definite: false, + }], + span: DUMMY_SP, + kind: VarDeclKind::Const, + declare: false, + })))]; + } + } - new_items - } + new_items + } - fn fold_export_decl(&mut self, export: ExportDecl) -> ExportDecl { - match &export.decl { - Decl::Var(var_decl) => { - for decl in &var_decl.decls { - let mut is_config = false; - if let Pat::Ident(ident) = &decl.name { - if &ident.id.sym == CONFIG_KEY { - is_config = true; - } - } + fn fold_export_decl(&mut self, export: ExportDecl) -> ExportDecl { + match &export.decl { + Decl::Var(var_decl) => { + for decl in &var_decl.decls { + let mut is_config = false; + if let Pat::Ident(ident) = &decl.name { + if &ident.id.sym == CONFIG_KEY { + is_config = true; + } + } - if is_config { - if let Some(expr) = &decl.init { - if let Expr::Object(obj) = &**expr { - for prop in &obj.props { - if let PropOrSpread::Prop(prop) = prop { - if let Prop::KeyValue(kv) = &**prop { - match &kv.key { - PropName::Ident(ident) => { - if &ident.sym == "amp" { - if let Expr::Lit(Lit::Bool(Bool { value, .. })) = &*kv.value { - if *value && self.is_page_file { - self.drop_bundle = true; - } - } else if let Expr::Lit(Lit::Str(_)) = &*kv.value { - // Do not replace bundle + if is_config { + if let Some(expr) = &decl.init { + if let Expr::Object(obj) = &**expr { + for prop in &obj.props { + if let PropOrSpread::Prop(prop) = prop { + if let Prop::KeyValue(kv) = &**prop { + match &kv.key { + PropName::Ident(ident) => { + if &ident.sym == "amp" { + if let Expr::Lit(Lit::Bool(Bool { + value, + .. + })) = &*kv.value + { + if *value && self.is_page_file { + self.drop_bundle = true; + } + } else if let Expr::Lit(Lit::Str(_)) = + &*kv.value + { + // Do not replace + // bundle + } else { + self.handle_error( + "Invalid value found.", + export.span, + ); + } + } + } + _ => { + self.handle_error( + "Invalid property found.", + export.span, + ); + } + } + } else { + self.handle_error( + "Invalid property or value.", + export.span, + ); + } + } else { + self.handle_error( + "Property spread is not allowed.", + export.span, + ); + } + } } else { - self.handle_error("Invalid value found.", export.span); + self.handle_error("Expected config to be an object.", export.span); } - } + } else { + self.handle_error("Expected config to be an object.", export.span); } - _ => { - self.handle_error("Invalid property found.", export.span); - } - } - } else { - self.handle_error("Invalid property or value.", export.span); } - } else { - self.handle_error("Property spread is not allowed.", export.span); - } } - } else { - self.handle_error("Expected config to be an object.", export.span); - } - } else { - self.handle_error("Expected config to be an object.", export.span); } - } + _ => {} } - } - _ => {} + export } - export - } - fn fold_export_named_specifier( - &mut self, - specifier: ExportNamedSpecifier, - ) -> ExportNamedSpecifier { - match &specifier.exported { - Some(ident) => { - if &ident.sym == CONFIG_KEY { - self.handle_error("Config cannot be re-exported.", specifier.span) - } - } - None => { - if &specifier.orig.sym == CONFIG_KEY { - self.handle_error("Config cannot be re-exported.", specifier.span) + fn fold_export_named_specifier( + &mut self, + specifier: ExportNamedSpecifier, + ) -> ExportNamedSpecifier { + match &specifier.exported { + Some(ident) => { + if let ModuleExportName::Ident(ident) = ident { + if &ident.sym == CONFIG_KEY { + self.handle_error("Config cannot be re-exported.", specifier.span) + } + } + } + None => { + if let ModuleExportName::Ident(ident) = &specifier.orig { + if &ident.sym == CONFIG_KEY { + self.handle_error("Config cannot be re-exported.", specifier.span) + } + } + } } - } + specifier } - specifier - } } impl PageConfig { - fn handle_error(&mut self, details: &str, span: Span) { - if self.is_page_file { - let message = format!("Invalid page config export found. {} \ + fn handle_error(&mut self, details: &str, span: Span) { + if self.is_page_file { + let message = format!("Invalid page config export found. {} \ See: https://nextjs.org/docs/messages/invalid-page-config", details); - HANDLER.with(|handler| handler.struct_span_err(span, &message).emit()); + HANDLER.with(|handler| handler.struct_span_err(span, &message).emit()); + } } - } } diff --git a/packages/next-swc/crates/core/src/shake_exports.rs b/packages/next-swc/crates/core/src/shake_exports.rs index 74e2abe5c895440..ba0e58ce89815bc 100644 --- a/packages/next-swc/crates/core/src/shake_exports.rs +++ b/packages/next-swc/crates/core/src/shake_exports.rs @@ -84,11 +84,15 @@ impl Fold for ExportShaker { .filter_map(|spec| { if let ExportSpecifier::Named(named_spec) = spec { if let Some(ident) = &named_spec.exported { + if let ModuleExportName::Ident(ident) = ident { + if self.ignore.contains(&ident.sym) { + return Some(ExportSpecifier::Named(named_spec)); + } + } + } else if let ModuleExportName::Ident(ident) = &named_spec.orig { if self.ignore.contains(&ident.sym) { return Some(ExportSpecifier::Named(named_spec)); } - } else if self.ignore.contains(&named_spec.orig.sym) { - return Some(ExportSpecifier::Named(named_spec)); } } None diff --git a/packages/next-swc/crates/core/tests/fixture.rs b/packages/next-swc/crates/core/tests/fixture.rs index e43e4a48a9cf822..f575c26c3d8c4e4 100644 --- a/packages/next-swc/crates/core/tests/fixture.rs +++ b/packages/next-swc/crates/core/tests/fixture.rs @@ -34,6 +34,7 @@ fn amp_attributes_fixture(input: PathBuf) { fn next_dynamic_fixture(input: PathBuf) { let output_dev = input.parent().unwrap().join("output-dev.js"); let output_prod = input.parent().unwrap().join("output-prod.js"); + let output_server = input.parent().unwrap().join("output-server.js"); test_fixture( syntax(), &|_tr| { @@ -60,6 +61,19 @@ fn next_dynamic_fixture(input: PathBuf) { &input, &output_prod, ); + test_fixture( + syntax(), + &|_tr| { + next_dynamic( + false, + true, + FileName::Real(PathBuf::from("/some-project/src/some-file.js")), + Some("/some-project/src".into()), + ) + }, + &input, + &output_server, + ); } #[fixture("tests/fixture/ssg/**/input.js")] diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/duplicated-imports/output-server.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/duplicated-imports/output-server.js new file mode 100644 index 000000000000000..871bf8fb3896749 --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/duplicated-imports/output-server.js @@ -0,0 +1,12 @@ +import dynamic1 from 'next/dynamic' +import dynamic2 from 'next/dynamic' +const DynamicComponent1 = dynamic1(() => import('../components/hello1'), { + loadableGenerated: { + modules: ['some-file.js -> ' + '../components/hello1'], + }, +}) +const DynamicComponent2 = dynamic2(() => import('../components/hello2'), { + loadableGenerated: { + modules: ['some-file.js -> ' + '../components/hello2'], + }, +}) diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/member-with-same-name/output-server.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/member-with-same-name/output-server.js new file mode 100644 index 000000000000000..c3f5016f39f3782 --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/member-with-same-name/output-server.js @@ -0,0 +1,8 @@ +import dynamic from 'next/dynamic' +import somethingElse from 'something-else' +const DynamicComponent = dynamic(() => import('../components/hello'), { + loadableGenerated: { + modules: ['some-file.js -> ' + '../components/hello'], + }, +}) +somethingElse.dynamic('should not be transformed') diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/no-options/output-server.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/no-options/output-server.js new file mode 100644 index 000000000000000..21763e18aa102d0 --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/no-options/output-server.js @@ -0,0 +1,6 @@ +import dynamic from 'next/dynamic' +const DynamicComponent = dynamic(() => import('../components/hello'), { + loadableGenerated: { + modules: ['some-file.js -> ' + '../components/hello'], + }, +}) diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/input.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/input.js index 91987b1357d35e3..82cb14f53566db1 100644 --- a/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/input.js +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/input.js @@ -4,3 +4,8 @@ const DynamicComponentWithCustomLoading = dynamic( () => import('../components/hello'), { loading: () =>

...

} ) + +const DynamicClientOnlyComponent = dynamic( + () => import('../components/hello'), + { ssr: false } +) diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-dev.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-dev.js index 7c9d62d7225a247..e8ef64cab52ee1e 100644 --- a/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-dev.js +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-dev.js @@ -8,3 +8,12 @@ const DynamicComponentWithCustomLoading = dynamic(()=>import("../components/hell }, loading: ()=>

...

}); +const DynamicClientOnlyComponent = dynamic(()=>import("../components/hello") +, { + loadableGenerated: { + modules: [ + "some-file.js -> " + "../components/hello" + ] + }, + ssr: false +}); \ No newline at end of file diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-prod.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-prod.js index cee511f2ded65ea..f5350433fd80b7e 100644 --- a/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-prod.js +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-prod.js @@ -8,3 +8,12 @@ const DynamicComponentWithCustomLoading = dynamic(()=>import("../components/hell }, loading: ()=>

...

}); +const DynamicClientOnlyComponent = dynamic(()=>import("../components/hello") +, { + loadableGenerated: { + webpack: ()=>[ + require.resolveWeak("../components/hello") + ] + }, + ssr: false +}); \ No newline at end of file diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-server.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-server.js new file mode 100644 index 000000000000000..0fb610435eb5254 --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-server.js @@ -0,0 +1,16 @@ +import dynamic from 'next/dynamic' +const DynamicComponentWithCustomLoading = dynamic( + () => import('../components/hello'), + { + loadableGenerated: { + modules: ['some-file.js -> ' + '../components/hello'], + }, + loading: () =>

...

, + } +) +const DynamicClientOnlyComponent = dynamic(null, { + loadableGenerated: { + modules: ['some-file.js -> ' + '../components/hello'], + }, + ssr: false, +}) diff --git a/packages/next-swc/crates/core/tests/fixture/next-dynamic/wrapped-import/output-server.js b/packages/next-swc/crates/core/tests/fixture/next-dynamic/wrapped-import/output-server.js new file mode 100644 index 000000000000000..dc2e6b9ecfa9f50 --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/next-dynamic/wrapped-import/output-server.js @@ -0,0 +1,11 @@ +import dynamic from "next/dynamic"; +const DynamicComponent = dynamic(null, { + loadableGenerated: { + modules: [ + "some-file.js -> " + "./components/hello" + ] + }, + loading: ()=>null + , + ssr: false +}); \ No newline at end of file diff --git a/packages/next-swc/crates/core/tests/fixture/ssg/getStaticProps/should-not-remove-import-used-in-render/input.js b/packages/next-swc/crates/core/tests/fixture/ssg/getStaticProps/should-not-remove-import-used-in-render/input.js new file mode 100644 index 000000000000000..196f6585af0a465 --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/ssg/getStaticProps/should-not-remove-import-used-in-render/input.js @@ -0,0 +1,38 @@ +import { useState, useEffect } from 'react' +import { Root, Children, JSXMemberExpression, AttributeValue, AttributeJSX, ValueInRender, ValueInEffect, UnusedInRender } from '../' + +export default function Test() { + const [x, setX] = useState(ValueInRender.value) + useEffect(() => { + setX(ValueInEffect.value) + }, []) + + return ( + +
+ } /> + +
+
+ ) +} + +export async function getStaticProps() { + return { + props: { + // simulate import usage inside getStaticProps + used: [ + // these import references should not be removed + Root.value, + Children.value, + AttributeValue.value, + AttributeJSX.value, + ValueInRender.value, + ValueInEffect.value, + JSXMemberExpression.value, + // this import reference should be removed + UnusedInRender.value, + ], + } + } +} diff --git a/packages/next-swc/crates/core/tests/fixture/ssg/getStaticProps/should-not-remove-import-used-in-render/output.js b/packages/next-swc/crates/core/tests/fixture/ssg/getStaticProps/should-not-remove-import-used-in-render/output.js new file mode 100644 index 000000000000000..06e38e50c3b907c --- /dev/null +++ b/packages/next-swc/crates/core/tests/fixture/ssg/getStaticProps/should-not-remove-import-used-in-render/output.js @@ -0,0 +1,15 @@ +import { useState, useEffect } from "react"; +import { Root, Children, JSXMemberExpression, AttributeValue, AttributeJSX, ValueInRender, ValueInEffect } from "../"; +export var __N_SSG = true; +export default function Test() { + const [x, setX] = useState(ValueInRender.value); + useEffect(() => { + setX(ValueInEffect.value); + }, []) + return __jsx(Root, { + x: x + }, __jsx('div', null, __jsx(Children, { + attr: AttributeValue, + jsx: __jsx(AttributeJSX, null) + }), __jsx(JSXMemberExpression.Deep.Property, null))); +} diff --git a/packages/next-swc/crates/core/tests/full/auto-cjs/1/output.js b/packages/next-swc/crates/core/tests/full/auto-cjs/1/output.js index f68146ba0ac4863..9cc7b3a4a1b7e87 100644 --- a/packages/next-swc/crates/core/tests/full/auto-cjs/1/output.js +++ b/packages/next-swc/crates/core/tests/full/auto-cjs/1/output.js @@ -1,8 +1,7 @@ "use strict"; -var _esm = _interopRequireDefault(require("esm")); -function _interopRequireDefault(a) { +var a = function(a) { return a && a.__esModule ? a : { default: a }; -} -console.log(_esm.default.foo), module.exports = _esm.default; +}(require("esm")); +console.log(a.default.foo), module.exports = a.default; diff --git a/packages/next-swc/crates/core/tests/full/example/output.js b/packages/next-swc/crates/core/tests/full/example/output.js index 9bf0ba8ff83a188..ebba00c28d0bc90 100644 --- a/packages/next-swc/crates/core/tests/full/example/output.js +++ b/packages/next-swc/crates/core/tests/full/example/output.js @@ -1,52 +1,47 @@ import a from "other"; -function _arrayLikeToArray(a, b) { +function b(a, b) { (null == b || b > a.length) && (b = a.length); - for(var b = 0, d = new Array(b); b < b; b++)d[b] = a[b]; + for(var c = 0, d = new Array(b); c < b; c++)d[c] = a[c]; return d; } -function _arrayWithHoles(a) { - if (Array.isArray(a)) return a; -} -function _classCallCheck(a, b) { - if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function"); -} -function _iterableToArrayLimit(a, b) { - var c, d, e = null == a ? null : "undefined" != typeof Symbol && a[Symbol.iterator] || a["@@iterator"]; - if (null != e) { - var f = [], g = !0, h = !1; - try { - for(e = e.call(a); !(g = (c = e.next()).done) && (f.push(c.value), !b || f.length !== b); g = !0); - } catch (i) { - h = !0, d = i; - } finally{ +(function(a, c) { + return (function(a) { + if (Array.isArray(a)) return a; + })(a) || (function(a, c) { + var d, e, f = null == a ? null : "undefined" != typeof Symbol && a[Symbol.iterator] || a["@@iterator"]; + if (null != f) { + var g = [], h = !0, i = !1; try { - g || null == e.return || e.return(); + for(f = f.call(a); !(h = (d = f.next()).done) && (g.push(d.value), !c || g.length !== c); h = !0); + } catch (j) { + i = !0, e = j; } finally{ - if (h) throw d; + try { + h || null == f.return || f.return(); + } finally{ + if (i) throw e; + } } + return g; } - return f; - } -} -function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} -function _slicedToArray(a, b) { - return _arrayWithHoles(a) || _iterableToArrayLimit(a, b) || _unsupportedIterableToArray(a, b) || _nonIterableRest(); -} -function _unsupportedIterableToArray(a, b) { - if (a) { - if ("string" == typeof a) return _arrayLikeToArray(a, b); - var c = Object.prototype.toString.call(a).slice(8, -1); - if ("Object" === c && a.constructor && (c = a.constructor.name), "Map" === c || "Set" === c) return Array.from(c); - if ("Arguments" === c || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)) return _arrayLikeToArray(a, b); - } -} -var _other = _slicedToArray(a, 1), foo = _other[0], Foo = function() { + })(a, c) || (function(a, c) { + if (a) { + if ("string" == typeof a) return b(a, c); + var d = Object.prototype.toString.call(a).slice(8, -1); + if ("Object" === d && a.constructor && (d = a.constructor.name), "Map" === d || "Set" === d) return Array.from(d); + if ("Arguments" === d || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)) return b(a, c); + } + })(a, c) || (function() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + })(); +})(a, 1)[0]; +var c = function() { "use strict"; - _classCallCheck(this, Foo); + !function(a, b) { + if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function"); + }(this, c); }; export var __N_SSG = !0; -export default function a() { +export default function d() { return React.createElement("div", null); }; diff --git a/packages/next-swc/crates/napi/Cargo.toml b/packages/next-swc/crates/napi/Cargo.toml index e051ebf3614c431..de8d313ea1ffb21 100644 --- a/packages/next-swc/crates/napi/Cargo.toml +++ b/packages/next-swc/crates/napi/Cargo.toml @@ -16,12 +16,12 @@ once_cell = "1.8.0" serde = "1" serde_json = "1" next-swc = { version = "0.0.0", path = "../core" } -swc = "0.98.0" +swc = "0.110.0" swc_atoms = "0.2.7" -swc_bundler = { version = "0.91.0", features = ["concurrent"] } -swc_common = { version = "0.15.0", features = ["concurrent", "sourcemap"] } -swc_ecma_loader = { version = "0.25.0", features = ["node", "lru"] } -swc_ecmascript = { version = "0.98.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc_bundler = { version = "0.98.0", features = ["concurrent"] } +swc_common = { version = "0.16.0", features = ["concurrent", "sourcemap"] } +swc_ecma_loader = { version = "0.26.0", features = ["node", "lru"] } +swc_ecmascript = { version = "0.105.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_node_base = "0.5.1" [build-dependencies] diff --git a/packages/next-swc/crates/napi/src/bundle/mod.rs b/packages/next-swc/crates/napi/src/bundle/mod.rs index 8c183480e453246..4d8b6fc7055d2c1 100644 --- a/packages/next-swc/crates/napi/src/bundle/mod.rs +++ b/packages/next-swc/crates/napi/src/bundle/mod.rs @@ -76,6 +76,7 @@ impl Task for BundleTask { disable_inliner: false, external_modules: builtins, module: swc_bundler::ModuleType::Es, + ..Default::default() }, Box::new(CustomHook), ); diff --git a/packages/next-swc/crates/wasm/Cargo.toml b/packages/next-swc/crates/wasm/Cargo.toml index 1aebf644bd8ed25..79ac28b8f5e19c1 100644 --- a/packages/next-swc/crates/wasm/Cargo.toml +++ b/packages/next-swc/crates/wasm/Cargo.toml @@ -16,9 +16,9 @@ path-clean = "0.1" serde = {version = "1", features = ["derive"]} serde_json = "1" next-swc = { version = "0.0.0", path = "../core" } -swc = "0.98.0" -swc_common = { version = "0.15.0", features = ["concurrent", "sourcemap"] } -swc_ecmascript = { version = "0.98.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } +swc = "0.110.0" +swc_common = { version = "0.16.0", features = ["concurrent", "sourcemap"] } +swc_ecmascript = { version = "0.105.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } tracing = {version = "0.1.28", features = ["release_max_level_off"]} wasm-bindgen = {version = "0.2", features = ["serde-serialize"]} wasm-bindgen-futures = "0.4.8" diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index 8da471a5622b10b..cb0f3e2d570d0e1 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "private": true, "scripts": { "build-native": "napi build --platform --cargo-name next_swc_napi native", diff --git a/packages/next/build/entries.ts b/packages/next/build/entries.ts index 262d0da81425b2d..c3045f7ecadd0ac 100644 --- a/packages/next/build/entries.ts +++ b/packages/next/build/entries.ts @@ -15,7 +15,10 @@ import { NextConfigComplete } from '../server/config-shared' import { isCustomErrorPage, isFlightPage, isReservedPage } from './utils' import { ssrEntries } from './webpack/plugins/middleware-plugin' import type { webpack5 } from 'next/dist/compiled/webpack/webpack' -import { MIDDLEWARE_SSR_RUNTIME_WEBPACK } from '../shared/lib/constants' +import { + MIDDLEWARE_RUNTIME_WEBPACK, + MIDDLEWARE_SSR_RUNTIME_WEBPACK, +} from '../shared/lib/constants' type ObjectValue = T extends { [key: string]: infer V } ? V : never export type PagesMapping = { @@ -291,6 +294,8 @@ export function finalizeEntrypoint({ name: ['_ENTRIES', `middleware_[name]`], type: 'assign', }, + runtime: MIDDLEWARE_RUNTIME_WEBPACK, + asyncChunks: false, ...entry, } return middlewareEntry diff --git a/packages/next/build/polyfills/process.js b/packages/next/build/polyfills/process.js new file mode 100644 index 000000000000000..054c87b91088681 --- /dev/null +++ b/packages/next/build/polyfills/process.js @@ -0,0 +1 @@ +module.exports = global.process || require('../../compiled/process') diff --git a/packages/next/build/utils.ts b/packages/next/build/utils.ts index b0332a1f5a89813..61691ce6d9e338c 100644 --- a/packages/next/build/utils.ts +++ b/packages/next/build/utils.ts @@ -1207,7 +1207,7 @@ export async function copyTracedFiles( for (const page of pageKeys) { if (MIDDLEWARE_ROUTE.test(page)) { const { files } = - middlewareManifest.middleware[page.replace(/\/_middleware$/, '')] + middlewareManifest.middleware[page.replace(/\/_middleware$/, '') || '/'] for (const file of files) { const originalPath = path.join(distDir, file) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index bbac49486d94a64..d60e3864dca69bf 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -635,7 +635,7 @@ export default async function getBaseWebpackConfig( os: require.resolve('next/dist/compiled/os-browserify'), path: require.resolve('next/dist/compiled/path-browserify'), punycode: require.resolve('next/dist/compiled/punycode'), - process: require.resolve('next/dist/compiled/process'), + process: require.resolve('./polyfills/process'), // Handled in separate alias querystring: require.resolve('next/dist/compiled/querystring-es3'), // TODO: investigate ncc'ing stream-browserify diff --git a/packages/next/build/webpack/plugins/middleware-plugin.ts b/packages/next/build/webpack/plugins/middleware-plugin.ts index 8c1ac1354544f4a..9f0c53abe43d5cf 100644 --- a/packages/next/build/webpack/plugins/middleware-plugin.ts +++ b/packages/next/build/webpack/plugins/middleware-plugin.ts @@ -6,6 +6,7 @@ import { MIDDLEWARE_FLIGHT_MANIFEST, MIDDLEWARE_BUILD_MANIFEST, MIDDLEWARE_REACT_LOADABLE_MANIFEST, + MIDDLEWARE_RUNTIME_WEBPACK, } from '../../../shared/lib/constants' import { MIDDLEWARE_ROUTE } from '../../../lib/constants' import { nonNullable } from '../../../lib/non-nullable' @@ -89,13 +90,7 @@ export default class MiddlewarePlugin { `server/${MIDDLEWARE_REACT_LOADABLE_MANIFEST}.js`, ...entryFiles.map((file) => 'server/' + file), ].filter(nonNullable) - : entryFiles.map((file: string) => - // we need to use the unminified version of the webpack runtime, - // remove if we do start minifying middleware chunks - file.startsWith('static/chunks/webpack-') - ? file.replace('webpack-', 'webpack-middleware-') - : file - ) + : entryFiles.map((file: string) => file) middlewareManifest.middleware[location] = { env: envPerRoute.get(entrypoint.name) || [], @@ -130,6 +125,15 @@ export default class MiddlewarePlugin { compiler.hooks.compilation.tap( PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + compilation.hooks.afterChunks.tap(PLUGIN_NAME, () => { + const middlewareRuntimeChunk = compilation.namedChunks.get( + MIDDLEWARE_RUNTIME_WEBPACK + ) + if (middlewareRuntimeChunk) { + middlewareRuntimeChunk.filenameTemplate = 'server/[name].js' + } + }) + const envPerRoute = new Map() compilation.hooks.afterOptimizeModules.tap(PLUGIN_NAME, () => { @@ -291,8 +295,6 @@ export default class MiddlewarePlugin { .tap(PLUGIN_NAME, ignore) const memberChainHandler = (_expr: any, members: string[]) => { - if (!isMiddlewareModule()) return - if (members.length >= 2 && members[0] === 'env') { const envName = members[1] const { buildInfo } = parser.state.module @@ -301,7 +303,7 @@ export default class MiddlewarePlugin { } buildInfo.nextUsedEnvVars.add(envName) - return true + if (isMiddlewareModule()) return true } } diff --git a/packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js b/packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js index aeffd6cd518f486..2d65a46ff7ca0ae 100644 --- a/packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js +++ b/packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js @@ -75,8 +75,6 @@ export class TerserPlugin { terserSpan.setAttribute('compilationName', compilation.name) return terserSpan.traceAsyncFn(async () => { - let webpackAsset = '' - let hasMiddleware = false let numberOfAssetsForMinify = 0 const assetsList = Object.keys(assets) @@ -99,15 +97,14 @@ export class TerserPlugin { return false } - // remove below if we start minifying middleware chunks - if (name.startsWith('static/chunks/webpack-')) { - webpackAsset = name - } - // don't minify _middleware as it can break in some cases // and doesn't provide too much of a benefit as it's server-side - if (name.match(/(middleware-chunks|_middleware\.js$)/)) { - hasMiddleware = true + if ( + name.match( + /(middleware-runtime\.js|middleware-chunks|_middleware\.js$)/ + ) + ) { + return false } const { info } = res @@ -145,17 +142,6 @@ export class TerserPlugin { }) ) - if (hasMiddleware && webpackAsset) { - // emit a separate version of the webpack - // runtime for the middleware - const asset = compilation.getAsset(webpackAsset) - compilation.emitAsset( - webpackAsset.replace('webpack-', 'webpack-middleware-'), - asset.source, - {} - ) - } - const numberOfWorkers = Math.min( numberOfAssetsForMinify, optimizeOptions.availableNumberOfCores diff --git a/packages/next/compiled/@vercel/nft/index.js b/packages/next/compiled/@vercel/nft/index.js index 3e8f0eac033b5ee..f5266a3525f7903 100644 --- a/packages/next/compiled/@vercel/nft/index.js +++ b/packages/next/compiled/@vercel/nft/index.js @@ -1,4 +1,4 @@ -(()=>{var __webpack_modules__={111:(e,t,r)=>{"use strict";e.exports=t;t.mockS3Http=r(7048).get_mockS3Http();t.mockS3Http("on");const a=t.mockS3Http("get");const o=r(7147);const s=r(1017);const u=r(1400);const c=r(9658);c.disableProgress();const d=r(5677);const f=r(2361).EventEmitter;const p=r(3837).inherits;const h=["clean","install","reinstall","build","rebuild","package","testpackage","publish","unpublish","info","testbinary","reveal","configure"];const v={};c.heading="node-pre-gyp";if(a){c.warn(`mocking s3 to ${process.env.node_pre_gyp_mock_s3}`)}Object.defineProperty(t,"find",{get:function(){return r(3093).find},enumerable:true});function Run({package_json_path:e="./package.json",argv:t}){this.package_json_path=e;this.commands={};const r=this;h.forEach((e=>{r.commands[e]=function(t,a){c.verbose("command",e,t);return require("./"+e)(r,t,a)}}));this.parseArgv(t);this.binaryHostSet=false}p(Run,f);t.Run=Run;const _=Run.prototype;_.package=r(9286);_.configDefs={help:Boolean,arch:String,debug:Boolean,directory:String,proxy:String,loglevel:String};_.shorthands={release:"--no-debug",C:"--directory",debug:"--debug",j:"--jobs",silent:"--loglevel=silent",silly:"--loglevel=silly",verbose:"--loglevel=verbose"};_.aliases=v;_.parseArgv=function parseOpts(e){this.opts=u(this.configDefs,this.shorthands,e);this.argv=this.opts.argv.remain.slice();const t=this.todo=[];e=this.argv.map((e=>{if(e in this.aliases){e=this.aliases[e]}return e}));e.slice().forEach((r=>{if(r in this.commands){const a=e.splice(0,e.indexOf(r));e.shift();if(t.length>0){t[t.length-1].args=a}t.push({name:r,args:[]})}}));if(t.length>0){t[t.length-1].args=e.splice(0)}let r=this.package_json_path;if(this.opts.directory){r=s.join(this.opts.directory,r)}this.package_json=JSON.parse(o.readFileSync(r));this.todo=d.expand_commands(this.package_json,this.opts,t);const a="npm_config_";Object.keys(process.env).forEach((e=>{if(e.indexOf(a)!==0)return;const t=process.env[e];if(e===a+"loglevel"){c.level=t}else{e=e.substring(a.length);if(e==="argv"){if(this.opts.argv&&this.opts.argv.remain&&this.opts.argv.remain.length){}else{this.opts[e]=t}}else{this.opts[e]=t}}}));if(this.opts.loglevel){c.level=this.opts.loglevel}c.resume()};_.setBinaryHostProperty=function(e){if(this.binaryHostSet){return this.package_json.binary.host}const t=this.package_json;if(!t||!t.binary||t.binary.host){return""}if(!t.binary.staging_host||!t.binary.production_host){return""}let r="production_host";if(e==="publish"){r="staging_host"}const a=process.env.node_pre_gyp_s3_host;if(a==="staging"||a==="production"){r=`${a}_host`}else if(this.opts["s3_host"]==="staging"||this.opts["s3_host"]==="production"){r=`${this.opts["s3_host"]}_host`}else if(this.opts["s3_host"]||a){throw new Error(`invalid s3_host ${this.opts["s3_host"]||a}`)}t.binary.host=t.binary[r];this.binaryHostSet=true;return t.binary.host};_.usage=function usage(){const e=[""," Usage: node-pre-gyp [options]",""," where is one of:",h.map((e=>" - "+e+" - "+require("./"+e).usage)).join("\n"),"","node-pre-gyp@"+this.version+" "+s.resolve(__dirname,".."),"node@"+process.versions.node].join("\n");return e};Object.defineProperty(_,"version",{get:function(){return this.package.version},enumerable:true})},3093:(e,t,r)=>{"use strict";const a=r(111);const o=r(302);const s=r(5677);const u=r(7147).existsSync||r(1017).existsSync;const c=r(1017);e.exports=t;t.usage="Finds the require path for the node-pre-gyp installed module";t.validate=function(e,t){o.validate_config(e,t)};t.find=function(e,t){if(!u(e)){throw new Error(e+"does not exist")}const r=new a.Run({package_json_path:e,argv:process.argv});r.setBinaryHostProperty();const d=r.package_json;o.validate_config(d,t);let f;if(s.get_napi_build_versions(d,t)){f=s.get_best_napi_build_version(d,t)}t=t||{};if(!t.module_root)t.module_root=c.dirname(e);const p=o.evaluate(d,t,f);return p.module}},5677:(e,t,r)=>{"use strict";const a=r(7147);e.exports=t;const o=process.version.substr(1).replace(/-.*$/,"").split(".").map((e=>+e));const s=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];const u="napi_build_version=";e.exports.get_napi_version=function(){let e=process.versions.napi;if(!e){if(o[0]===9&&o[1]>=3)e=2;else if(o[0]===8)e=1}return e};e.exports.get_napi_version_as_string=function(t){const r=e.exports.get_napi_version(t);return r?""+r:""};e.exports.validate_package_json=function(t,r){const a=t.binary;const o=pathOK(a.module_path);const s=pathOK(a.remote_path);const u=pathOK(a.package_name);const c=e.exports.get_napi_build_versions(t,r,true);const d=e.exports.get_napi_build_versions_raw(t);if(c){c.forEach((e=>{if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(c&&(!o||!s&&!u)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||s||u)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(c&&!e.exports.get_best_napi_build_version(t,r)&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!c&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,r,a){const o=[];const c=e.exports.get_napi_build_versions(t,r);a.forEach((a=>{if(c&&a.name==="install"){const s=e.exports.get_best_napi_build_version(t,r);const c=s?[u+s]:[];o.push({name:a.name,args:c})}else if(c&&s.indexOf(a.name)!==-1){c.forEach((e=>{const t=a.args.slice();t.push(u+e);o.push({name:a.name,args:t})}))}else{o.push(a)}}));return o};e.exports.get_napi_build_versions=function(t,a,o){const s=r(9658);let u=[];const c=e.exports.get_napi_version(a?a.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((e=>{const t=u.indexOf(e)!==-1;if(!t&&c&&e<=c){u.push(e)}else if(o&&!t&&c){s.info("This Node instance does not support builds for Node-API version",e)}}))}if(a&&a["build-latest-napi-version-only"]){let e=0;u.forEach((t=>{if(t>e)e=t}));u=e?[e]:[]}return u.length?u:undefined};e.exports.get_napi_build_versions_raw=function(e){const t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((e=>{if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return u+e};e.exports.get_napi_build_version_from_command_args=function(e){for(let t=0;t{if(e>a&&e<=t){a=e}}))}return a===0?undefined:a};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},7048:(e,t,r)=>{"use strict";e.exports=t;const a=r(7310);const o=r(7147);const s=r(1017);e.exports.detect=function(e,t){const r=e.hosted_path;const o=a.parse(r);t.prefix=!o.pathname||o.pathname==="/"?"":o.pathname.replace("/","");if(e.bucket&&e.region){t.bucket=e.bucket;t.region=e.region;t.endpoint=e.host;t.s3ForcePathStyle=e.s3ForcePathStyle}else{const e=o.hostname.split(".s3");const r=e[0];if(!r){return}if(!t.bucket){t.bucket=r}if(!t.region){const r=e[1].slice(1).split(".")[0];if(r==="amazonaws"){t.region="us-east-1"}else{t.region=r}}}};e.exports.get_s3=function(e){if(process.env.node_pre_gyp_mock_s3){const e=r(2722);const t=r(2037);e.config.basePath=`${t.tmpdir()}/mock`;const a=e.S3();const wcb=e=>(t,...r)=>{if(t&&t.code==="ENOENT"){t.code="NotFound"}return e(t,...r)};return{listObjects(e,t){return a.listObjects(e,wcb(t))},headObject(e,t){return a.headObject(e,wcb(t))},deleteObject(e,t){return a.deleteObject(e,wcb(t))},putObject(e,t){return a.putObject(e,wcb(t))}}}const t=r(918);t.config.update(e);const a=new t.S3;return{listObjects(e,t){return a.listObjects(e,t)},headObject(e,t){return a.headObject(e,t)},deleteObject(e,t){return a.deleteObject(e,t)},putObject(e,t){return a.putObject(e,t)}}};e.exports.get_mockS3Http=function(){let e=false;if(!process.env.node_pre_gyp_mock_s3){return()=>e}const t=r(3902);const a="https://mapbox-node-pre-gyp-public-testing-bucket.s3.us-east-1.amazonaws.com";const u=process.env.node_pre_gyp_mock_s3+"/mapbox-node-pre-gyp-public-testing-bucket";const mock_http=()=>{function get(e,t){const r=s.join(u,e.replace("%2B","+"));try{o.accessSync(r,o.constants.R_OK)}catch(e){return[404,"not found\n"]}return[200,o.createReadStream(r)]}return t(a).persist().get((()=>e)).reply(get)};mock_http(t,a,u);const mockS3Http=t=>{const r=e;if(t==="off"){e=false}else if(t==="on"){e=true}else if(t!=="get"){throw new Error(`illegal action for setMockHttp ${t}`)}return r};return mockS3Http}},302:(e,t,r)=>{"use strict";e.exports=t;const a=r(1017);const o=r(7849);const s=r(7310);const u=r(2157);const c=r(5677);let d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=r(2339)}const f={};Object.keys(d).forEach((e=>{const t=e.split(".")[0];if(!f[t]){f[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}const r=o.parse(t);return e+"-v"+r.major+"."+r.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}const r=o.parse(t.node);if(r.major===0&&r.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!=="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{let r;if(d[t]){r=d[t]}else{const e=t.split(".").map((e=>+e));if(e.length!==3){throw new Error("Unknown target version: "+t)}const a=e[0];let o=e[1];let s=e[2];if(a===1){while(true){if(o>0)--o;if(s>0)--s;const e=""+a+"."+o+"."+s;if(d[e]){r=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}if(o===0&&s===0){break}}}else if(a>=2){if(f[a]){r=d[f[a]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+f[a]+" as ABI compatible target")}}else if(a===0){if(e[1]%2===0){while(--s>0){const e=""+a+"."+o+"."+s;if(d[e]){r=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}}}}}if(!r){throw new Error("Unsupported target version: "+t)}const a={node:t,v8:r.v8+".0",modules:r.node_abi>1?r.node_abi:undefined};return get_node_abi(e,a)}}}e.exports.get_runtime_abi=get_runtime_abi;const p=["module_name","module_path","host"];function validate_config(e,t){const r=e.name+" package.json is not node-pre-gyp ready:\n";const a=[];if(!e.main){a.push("main")}if(!e.version){a.push("version")}if(!e.name){a.push("name")}if(!e.binary){a.push("binary")}const o=e.binary;if(o){p.forEach((e=>{if(!o[e]||typeof o[e]!=="string"){a.push("binary."+e)}}))}if(a.length>=1){throw new Error(r+"package.json must declare these properties: \n"+a.join("\n"))}if(o){const e=s.parse(o.host).protocol;if(e==="http:"){throw new Error("'host' protocol ("+e+") is invalid - only 'https:' is accepted")}}c.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((r=>{const a="{"+r+"}";while(e.indexOf(a)>-1){e=e.replace(a,t[r])}}));return e}function fix_slashes(e){if(e.slice(-1)!=="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){let t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;const h="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";const v="";e.exports.evaluate=function(e,t,r){t=t||{};validate_config(e,t);const d=e.version;const f=o.parse(d);const p=t.runtime||get_process_runtime(process.versions);const _={name:e.name,configuration:t.debug?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:f.version,prerelease:f.prerelease.length?f.prerelease.join("."):"",build:f.build.length?f.build.join("."):"",major:f.major,minor:f.minor,patch:f.patch,runtime:p,node_abi:get_runtime_abi(p,t.target),node_abi_napi:c.get_napi_version(t.target)?"napi":get_runtime_abi(p,t.target),napi_version:c.get_napi_version(t.target),napi_build_version:r||"",node_napi_label:r?"napi-v"+r:get_runtime_abi(p,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||u.family||"unknown",module_main:e.main,toolset:t.toolset||"",bucket:e.binary.bucket,region:e.binary.region,s3ForcePathStyle:e.binary.s3ForcePathStyle||false};const g=_.module_name.replace("-","_");const y=process.env["npm_config_"+g+"_binary_host_mirror"]||e.binary.host;_.host=fix_slashes(eval_template(y,_));_.module_path=eval_template(e.binary.module_path,_);if(t.module_root){_.module_path=a.join(t.module_root,_.module_path)}else{_.module_path=a.resolve(_.module_path)}_.module=a.join(_.module_path,_.module_name+".node");_.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,_))):v;const m=e.binary.package_name?e.binary.package_name:h;_.package_name=eval_template(m,_);_.staged_tarball=a.join("build/stage",_.remote_path,_.package_name);_.hosted_path=s.resolve(_.host,_.remote_path);_.hosted_tarball=s.resolve(_.hosted_path,_.package_name);return _}},1400:(e,t,r)=>{var a=process.env.DEBUG_NOPT||process.env.NOPT_DEBUG?function(){console.error.apply(console,arguments)}:function(){};var o=r(7310),s=r(1017),u=r(2781).Stream,c=r(5920),d=r(2037);e.exports=t=nopt;t.clean=clean;t.typeDefs={String:{type:String,validate:validateString},Boolean:{type:Boolean,validate:validateBoolean},url:{type:o,validate:validateUrl},Number:{type:Number,validate:validateNumber},path:{type:s,validate:validatePath},Stream:{type:u,validate:validateStream},Date:{type:Date,validate:validateDate}};function nopt(e,r,o,s){o=o||process.argv;e=e||{};r=r||{};if(typeof s!=="number")s=2;a(e,r,o,s);o=o.slice(s);var u={},c,d={remain:[],cooked:o,original:o.slice(0)};parse(o,u,d.remain,e,r);clean(u,e,t.typeDefs);u.argv=d;Object.defineProperty(u.argv,"toString",{value:function(){return this.original.map(JSON.stringify).join(" ")},enumerable:false});return u}function clean(e,r,o){o=o||t.typeDefs;var s={},u=[false,true,null,String,Array];Object.keys(e).forEach((function(c){if(c==="argv")return;var d=e[c],f=Array.isArray(d),p=r[c];if(!f)d=[d];if(!p)p=u;if(p===Array)p=u.concat(Array);if(!Array.isArray(p))p=[p];a("val=%j",d);a("types=",p);d=d.map((function(u){if(typeof u==="string"){a("string %j",u);u=u.trim();if(u==="null"&&~p.indexOf(null)||u==="true"&&(~p.indexOf(true)||~p.indexOf(Boolean))||u==="false"&&(~p.indexOf(false)||~p.indexOf(Boolean))){u=JSON.parse(u);a("jsonable %j",u)}else if(~p.indexOf(Number)&&!isNaN(u)){a("convert to number",u);u=+u}else if(~p.indexOf(Date)&&!isNaN(Date.parse(u))){a("convert to date",u);u=new Date(u)}}if(!r.hasOwnProperty(c)){return u}if(u===false&&~p.indexOf(null)&&!(~p.indexOf(false)||~p.indexOf(Boolean))){u=null}var d={};d[c]=u;a("prevalidated val",d,u,r[c]);if(!validate(d,c,u,r[c],o)){if(t.invalidHandler){t.invalidHandler(c,u,r[c],e)}else if(t.invalidHandler!==false){a("invalid: "+c+"="+u,r[c])}return s}a("validated val",d,u,r[c]);return d[c]})).filter((function(e){return e!==s}));if(!d.length&&p.indexOf(Array)===-1){a("VAL HAS NO LENGTH, DELETE IT",d,c,p.indexOf(Array));delete e[c]}else if(f){a(f,e[c],d);e[c]=d}else e[c]=d[0];a("k=%s val=%j",c,d,e[c])}))}function validateString(e,t,r){e[t]=String(r)}function validatePath(e,t,r){if(r===true)return false;if(r===null)return true;r=String(r);var a=process.platform==="win32",o=a?/^~(\/|\\)/:/^~\//,u=d.homedir();if(u&&r.match(o)){e[t]=s.resolve(u,r.substr(2))}else{e[t]=s.resolve(r)}return true}function validateNumber(e,t,r){a("validate Number %j %j %j",t,r,isNaN(r));if(isNaN(r))return false;e[t]=+r}function validateDate(e,t,r){var o=Date.parse(r);a("validate Date %j %j %j",t,r,o);if(isNaN(o))return false;e[t]=new Date(r)}function validateBoolean(e,t,r){if(r instanceof Boolean)r=r.valueOf();else if(typeof r==="string"){if(!isNaN(r))r=!!+r;else if(r==="null"||r==="false")r=false;else r=true}else r=!!r;e[t]=r}function validateUrl(e,t,r){r=o.parse(String(r));if(!r.host)return false;e[t]=r.href}function validateStream(e,t,r){if(!(r instanceof u))return false;e[t]=r}function validate(e,t,r,o,s){if(Array.isArray(o)){for(var u=0,c=o.length;u1){var _=h.indexOf("=");if(_>-1){v=true;var g=h.substr(_+1);h=h.substr(0,_);e.splice(p,1,h,g)}var y=resolveShort(h,s,f,d);a("arg=%j shRes=%j",h,y);if(y){a(h,y);e.splice.apply(e,[p,1].concat(y));if(h!==y[0]){p--;continue}}h=h.replace(/^-+/,"");var m=null;while(h.toLowerCase().indexOf("no-")===0){m=!m;h=h.substr(3)}if(d[h])h=d[h];var w=o[h];var x=Array.isArray(w);if(x&&w.length===1){x=false;w=w[0]}var E=w===Array||x&&w.indexOf(Array)!==-1;if(!o.hasOwnProperty(h)&&t.hasOwnProperty(h)){if(!Array.isArray(t[h]))t[h]=[t[h]];E=true}var S,k=e[p+1];var R=typeof m==="boolean"||w===Boolean||x&&w.indexOf(Boolean)!==-1||typeof w==="undefined"&&!v||k==="false"&&(w===null||x&&~w.indexOf(null));if(R){S=!m;if(k==="true"||k==="false"){S=JSON.parse(k);k=null;if(m)S=!S;p++}if(x&&k){if(~w.indexOf(k)){S=k;p++}else if(k==="null"&&~w.indexOf(null)){S=null;p++}else if(!k.match(/^-{2,}[^-]/)&&!isNaN(k)&&~w.indexOf(Number)){S=+k;p++}else if(!k.match(/^-[^-]/)&&~w.indexOf(String)){S=k;p++}}if(E)(t[h]=t[h]||[]).push(S);else t[h]=S;continue}if(w===String){if(k===undefined){k=""}else if(k.match(/^-{1,2}[^-]+/)){k="";p--}}if(k&&k.match(/^-{2,}$/)){k=undefined;p--}S=k===undefined?true:k;if(E)(t[h]=t[h]||[]).push(S);else t[h]=S;p++;continue}r.push(h)}}function resolveShort(e,t,r,o){e=e.replace(/^-+/,"");if(o[e]===e)return null;if(t[e]){if(t[e]&&!Array.isArray(t[e]))t[e]=t[e].split(/\s+/);return t[e]}var s=t.___singles;if(!s){s=Object.keys(t).filter((function(e){return e.length===1})).reduce((function(e,t){e[t]=true;return e}),{});t.___singles=s;a("shorthand singles",s)}var u=e.split("").filter((function(e){return s[e]}));if(u.join("")===e)return u.map((function(e){return t[e]})).reduce((function(e,t){return e.concat(t)}),[]);if(o[e]&&!t[e])return null;if(r[e])e=r[e];if(t[e]&&!Array.isArray(t[e]))t[e]=t[e].split(/\s+/);return t[e]}},6286:(e,t,r)=>{const a=r(9491);const o=r(1017);const s=r(7147);let u=undefined;try{u=r(3535)}catch(e){}const c={nosort:true,silent:true};let d=0;const f=process.platform==="win32";const defaults=e=>{const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||s[t];t=t+"Sync";e[t]=e[t]||s[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&u===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||c};const rimraf=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof r,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);let o=0;let s=null;let c=0;const next=e=>{s=s||e;if(--c===0)r(s)};const afterGlob=(e,a)=>{if(e)return r(e);c=a.length;if(c===0)return r();a.forEach((e=>{const CB=r=>{if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&orimraf_(e,t,CB)),o*100)}if(r.code==="EMFILE"&&drimraf_(e,t,CB)),d++)}if(r.code==="ENOENT")r=null}d=0;next(r)};rimraf_(e,t,CB)}))};if(t.disableGlob||!u.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,((r,a)=>{if(!r)return afterGlob(null,[e]);u(e,t.glob,afterGlob)}))};const rimraf_=(e,t,r)=>{a(e);a(t);a(typeof r==="function");t.lstat(e,((a,o)=>{if(a&&a.code==="ENOENT")return r(null);if(a&&a.code==="EPERM"&&f)fixWinEPERM(e,t,a,r);if(o&&o.isDirectory())return rmdir(e,t,a,r);t.unlink(e,(a=>{if(a){if(a.code==="ENOENT")return r(null);if(a.code==="EPERM")return f?fixWinEPERM(e,t,a,r):rmdir(e,t,a,r);if(a.code==="EISDIR")return rmdir(e,t,a,r)}return r(a)}))}))};const fixWinEPERM=(e,t,r,o)=>{a(e);a(t);a(typeof o==="function");t.chmod(e,438,(a=>{if(a)o(a.code==="ENOENT"?null:r);else t.stat(e,((a,s)=>{if(a)o(a.code==="ENOENT"?null:r);else if(s.isDirectory())rmdir(e,t,r,o);else t.unlink(e,o)}))}))};const fixWinEPERMSync=(e,t,r)=>{a(e);a(t);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT")return;else throw r}let o;try{o=t.statSync(e)}catch(e){if(e.code==="ENOENT")return;else throw r}if(o.isDirectory())rmdirSync(e,t,r);else t.unlinkSync(e)};const rmdir=(e,t,r,o)=>{a(e);a(t);a(typeof o==="function");t.rmdir(e,(a=>{if(a&&(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM"))rmkids(e,t,o);else if(a&&a.code==="ENOTDIR")o(r);else o(a)}))};const rmkids=(e,t,r)=>{a(e);a(t);a(typeof r==="function");t.readdir(e,((a,s)=>{if(a)return r(a);let u=s.length;if(u===0)return t.rmdir(e,r);let c;s.forEach((a=>{rimraf(o.join(e,a),t,(a=>{if(c)return;if(a)return r(c=a);if(--u===0)t.rmdir(e,r)}))}))}))};const rimrafSync=(e,t)=>{t=t||{};defaults(t);a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a(t,"rimraf: missing options");a.equal(typeof t,"object","rimraf: options should be object");let r;if(t.disableGlob||!u.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(a){r=u.sync(e,t.glob)}}if(!r.length)return;for(let e=0;e{a(e);a(t);try{t.rmdirSync(e)}catch(a){if(a.code==="ENOENT")return;if(a.code==="ENOTDIR")throw r;if(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM")rmkidsSync(e,t)}};const rmkidsSync=(e,t)=>{a(e);a(t);t.readdirSync(e).forEach((r=>rimrafSync(o.join(e,r),t)));const r=f?100:1;let s=0;do{let a=true;try{const o=t.rmdirSync(e,t);a=false;return o}finally{if(++sq,env:{NODE_ENV:u.UNKNOWN,[u.UNKNOWN]:true},[u.UNKNOWN]:true};const T=Symbol();const C=Symbol();const j=Symbol();const N=Symbol();const L=Symbol();const I=Symbol();const P=Symbol();const D=Symbol();const M={access:I,accessSync:I,createReadStream:I,exists:I,existsSync:I,fstat:I,fstatSync:I,lstat:I,lstatSync:I,open:I,readFile:I,readFileSync:I,stat:I,statSync:I};const W=Object.assign(Object.create(null),{bindings:{default:P},express:{default:function(){return{[u.UNKNOWN]:true,set:T,engine:C}}},fs:Object.assign({default:M},M),process:Object.assign({default:O},O),path:{default:{}},os:Object.assign({default:k.default},k.default),"@mapbox/node-pre-gyp":Object.assign({default:w.default},w.default),"node-pre-gyp":v.pregyp,"node-pre-gyp/lib/pre-binding":v.pregyp,"node-pre-gyp/lib/pre-binding.js":v.pregyp,"node-gyp-build":{default:D},nbind:{init:j,default:{init:j}},"resolve-from":{default:A.default},"strong-globalize":{default:{SetRootDir:N},SetRootDir:N},pkginfo:{default:L}});const F={_interopRequireDefault:_.normalizeDefaultRequire,_interopRequireWildcard:_.normalizeWildcardRequire,__importDefault:_.normalizeDefaultRequire,__importStar:_.normalizeWildcardRequire,MONGOOSE_DRIVER_PATH:undefined,URL:x.URL,Object:{assign:Object.assign}};F.global=F.GLOBAL=F.globalThis=F;const B=Symbol();v.pregyp.find[B]=true;const $=W.path;Object.keys(o.default).forEach((e=>{const t=o.default[e];if(typeof t==="function"){const r=function mockPath(){return t.apply(mockPath,arguments)};r[B]=true;$[e]=$.default[e]=r}else{$[e]=$.default[e]=t}}));$.resolve=$.default.resolve=function(...e){return o.default.resolve.apply(this,[q,...e])};$.resolve[B]=true;const U=new Set([".h",".cmake",".c",".cpp"]);const H=new Set(["CHANGELOG.md","README.md","readme.md","changelog.md"]);let q;const G=/^\/[^\/]+|^[a-z]:[\\/][^\\/]+/i;function isAbsolutePathOrUrl(e){if(e instanceof x.URL)return e.protocol==="file:";if(typeof e==="string"){if(e.startsWith("file:")){try{new x.URL(e);return true}catch(e){return false}}return G.test(e)}return false}const K=Symbol();const z=/([\/\\]\*\*[\/\\]\*)+/g;async function analyze(e,t,r){const a=new Set;const c=new Set;const _=new Set;const w=o.default.dirname(e);q=r.cwd;const k=h.getPackageBase(e);const emitAssetDirectory=e=>{if(!r.analysis.emitGlobs)return;const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);const d=e.substr(s);const f=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.sep?"**/*":"*")).replace(z,"/**/*")||"/**/*";if(r.ignoreFn(o.default.relative(r.base,c+f)))return;A=A.then((async()=>{if(r.log)console.log("Globbing "+c+f);const e=await new Promise(((e,t)=>p.default(c+f,{mark:true,ignore:c+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));e.filter((e=>!U.has(o.default.extname(e))&&!H.has(o.default.basename(e))&&!e.endsWith("/"))).forEach((e=>a.add(e)))}))};let A=Promise.resolve();t=t.replace(/^#![^\n\r]*[\r\n]/,"");let M;let $=false;try{M=S.parse(t,{ecmaVersion:"latest",allowReturnOutsideFunction:true});$=false}catch(t){const a=t&&t.message&&t.message.includes("sourceType: module");if(!a){r.warnings.add(new Error(`Failed to parse ${e} as script:\n${t&&t.message}`))}}if(!M){try{M=S.parse(t,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:true});$=true}catch(t){r.warnings.add(new Error(`Failed to parse ${e} as module:\n${t&&t.message}`));return{assets:a,deps:c,imports:_,isESM:false}}}const V=x.pathToFileURL(e).href;const Y=Object.assign(Object.create(null),{__dirname:{shadowDepth:0,value:{value:o.default.resolve(e,"..")}},__filename:{shadowDepth:0,value:{value:e}},process:{shadowDepth:0,value:{value:O}}});if(!$||r.mixedModules){Y.require={shadowDepth:0,value:{value:{[u.FUNCTION](e){c.add(e);const t=W[e];return t.default},resolve(t){return y.default(t,e,r)}}}};Y.require.value.value.resolve[B]=true}function setKnownBinding(e,t){if(e==="require")return;Y[e]={shadowDepth:0,value:t}}function getKnownBinding(e){const t=Y[e];if(t){if(t.shadowDepth===0){return t.value}}return undefined}function hasKnownBindingValue(e){const t=Y[e];return t&&t.shadowDepth===0}if(($||r.mixedModules)&&isAst(M)){for(const e of M.body){if(e.type==="ImportDeclaration"){const t=String(e.source.value);c.add(t);const r=W[t];if(r){for(const t of e.specifiers){if(t.type==="ImportNamespaceSpecifier")setKnownBinding(t.local.name,{value:r});else if(t.type==="ImportDefaultSpecifier"&&"default"in r)setKnownBinding(t.local.name,{value:r.default});else if(t.type==="ImportSpecifier"&&t.imported.name in r)setKnownBinding(t.local.name,{value:r[t.imported.name]})}}}else if(e.type==="ExportNamedDeclaration"||e.type==="ExportAllDeclaration"){if(e.source)c.add(String(e.source.value))}}}async function computePureStaticValue(e,t=true){const r=Object.create(null);Object.keys(F).forEach((e=>{r[e]={value:F[e]}}));Object.keys(Y).forEach((e=>{r[e]=getKnownBinding(e)}));r["import.meta"]={url:V};const a=await u.evaluate(e,r,t);return a}let Q;let X;let Z=false;function emitWildcardRequire(e){if(!r.analysis.emitGlobs||!e.startsWith("./")&&!e.startsWith("../"))return;e=o.default.resolve(w,e);const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);const d=e.substr(s);let f=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.sep?"**/*":"*"))||"/**/*";if(!f.endsWith("*"))f+="?("+(r.ts?".ts|.tsx|":"")+".js|.json|.node)";if(r.ignoreFn(o.default.relative(r.base,c+f)))return;A=A.then((async()=>{if(r.log)console.log("Globbing "+c+f);const e=await new Promise(((e,t)=>p.default(c+f,{mark:true,ignore:c+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));e.filter((e=>!U.has(o.default.extname(e))&&!H.has(o.default.basename(e))&&!e.endsWith("/"))).forEach((e=>a.add(e)))}))}async function processRequireArg(e,t=false){if(e.type==="ConditionalExpression"){await processRequireArg(e.consequent,t);await processRequireArg(e.alternate,t);return}if(e.type==="LogicalExpression"){await processRequireArg(e.left,t);await processRequireArg(e.right,t);return}let r=await computePureStaticValue(e,true);if(!r)return;if("value"in r&&typeof r.value==="string"){if(!r.wildcards)(t?_:c).add(r.value);else if(r.wildcards.length>=1)emitWildcardRequire(r.value)}else{if("then"in r&&typeof r.then==="string")(t?_:c).add(r.then);if("else"in r&&typeof r.else==="string")(t?_:c).add(r.else)}}let J=s.attachScopes(M,"scope");if(isAst(M)){R.handleWrappers(M);await g.default({id:e,ast:M,emitAsset:e=>a.add(e),emitAssetDirectory:emitAssetDirectory,job:r})}async function backtrack(e,t){if(!Q)throw new Error("Internal error: No staticChildNode for backtrack.");const r=await computePureStaticValue(e,true);if(r){if("value"in r&&typeof r.value!=="symbol"||"then"in r&&typeof r.then!=="symbol"&&typeof r.else!=="symbol"){X=r;Q=e;if(t)t.skip();return}}await emitStaticChildAsset()}await E(M,{async enter(t,s){var u;const p=t;const h=s;if(p.scope){J=p.scope;for(const e in p.scope.declarations){if(e in Y)Y[e].shadowDepth++}}if(Q)return;if(!h)return;if(p.type==="Identifier"){if(f.isIdentifierRead(p,h)&&r.analysis.computeFileReferences){let e;if(typeof(e=(u=getKnownBinding(p.name))===null||u===void 0?void 0:u.value)==="string"&&e.match(G)||e&&(typeof e==="function"||typeof e==="object")&&e[B]){X={value:typeof e==="string"?e:undefined};Q=p;await backtrack(h,this)}}}else if(r.analysis.computeFileReferences&&p.type==="MemberExpression"&&p.object.type==="MetaProperty"&&p.object.meta.name==="import"&&p.object.property.name==="meta"&&(p.property.computed?p.property.value:p.property.name)==="url"){X={value:V};Q=p;await backtrack(h,this)}else if(p.type==="ImportExpression"){await processRequireArg(p.source,true);return}else if(p.type==="CallExpression"){if((!$||r.mixedModules)&&p.callee.type==="Identifier"&&p.arguments.length){if(p.callee.name==="require"&&Y.require.shadowDepth===0){await processRequireArg(p.arguments[0]);return}}else if((!$||r.mixedModules)&&p.callee.type==="MemberExpression"&&p.callee.object.type==="Identifier"&&p.callee.object.name==="module"&&"module"in Y===false&&p.callee.property.type==="Identifier"&&!p.callee.computed&&p.callee.property.name==="require"&&p.arguments.length){await processRequireArg(p.arguments[0]);return}const t=r.analysis.evaluatePureExpressions&&await computePureStaticValue(p.callee,false);if(t&&"value"in t&&typeof t.value==="function"&&t.value[B]&&r.analysis.computeFileReferences){X=await computePureStaticValue(p,true);if(X&&h){Q=p;await backtrack(h,this)}}else if(t&&"value"in t&&typeof t.value==="symbol"){switch(t.value){case K:if(p.arguments.length===1&&p.arguments[0].type==="Literal"&&p.callee.type==="Identifier"&&Y.require.shadowDepth===0){await processRequireArg(p.arguments[0])}break;case P:if(p.arguments.length){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&e.value){let t;if(typeof e.value==="object")t=e.value;else if(typeof e.value==="string")t={bindings:e.value};if(!t.path){t.path=true}t.module_root=k;let r;try{r=d.default(t)}catch(e){}if(r){X={value:r};Q=p;await emitStaticChildAsset()}}}break;case D:if(p.arguments.length===1&&p.arguments[0].type==="Identifier"&&p.arguments[0].name==="__dirname"&&Y.__dirname.shadowDepth===0){let e;try{e=m.default.path(w)}catch(e){}if(e){X={value:e};Q=p;await emitStaticChildAsset()}}break;case j:if(p.arguments.length){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&(typeof e.value==="string"||typeof e.value==="undefined")){const t=v.nbind(e.value);if(t&&t.path){c.add(o.default.relative(w,t.path).replace(/\\/g,"/"));return this.skip()}}}break;case T:if(p.arguments.length===2&&p.arguments[0].type==="Literal"&&p.arguments[0].value==="view engine"&&!Z){await processRequireArg(p.arguments[1]);return this.skip()}break;case C:Z=true;break;case I:if(p.arguments[0]&&r.analysis.computeFileReferences){X=await computePureStaticValue(p.arguments[0],true);if(X){Q=p.arguments[0];await backtrack(h,this);return this.skip()}}break;case N:if(p.arguments[0]){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&e.value)emitAssetDirectory(e.value+"/intl");return this.skip()}break;case L:let t=o.default.resolve(e,"../package.json");const s=o.default.resolve("/package.json");while(t!==s&&await r.stat(t)===null)t=o.default.resolve(t,"../../package.json");if(t!==s)a.add(t);break}}}else if(p.type==="VariableDeclaration"&&h&&!f.isVarLoop(h)&&r.analysis.evaluatePureExpressions){for(const e of p.declarations){if(!e.init)continue;const t=await computePureStaticValue(e.init,true);if(t){if(e.id.type==="Identifier"){setKnownBinding(e.id.name,t)}else if(e.id.type==="ObjectPattern"&&"value"in t){for(const r of e.id.properties){if(r.type!=="Property"||r.key.type!=="Identifier"||r.value.type!=="Identifier"||typeof t.value!=="object"||t.value===null||!(r.key.name in t.value))continue;setKnownBinding(r.value.name,{value:t.value[r.key.name]})}}if(!("value"in t)&&isAbsolutePathOrUrl(t.then)&&isAbsolutePathOrUrl(t.else)){X=t;Q=e.init;await emitStaticChildAsset()}}}}else if(p.type==="AssignmentExpression"&&h&&!f.isLoop(h)&&r.analysis.evaluatePureExpressions){if(!hasKnownBindingValue(p.left.name)){const e=await computePureStaticValue(p.right,false);if(e&&"value"in e){if(p.left.type==="Identifier"){setKnownBinding(p.left.name,e)}else if(p.left.type==="ObjectPattern"){for(const t of p.left.properties){if(t.type!=="Property"||t.key.type!=="Identifier"||t.value.type!=="Identifier"||typeof e.value!=="object"||e.value===null||!(t.key.name in e.value))continue;setKnownBinding(t.value.name,{value:e.value[t.key.name]})}}if(isAbsolutePathOrUrl(e.value)){X=e;Q=p.right;await emitStaticChildAsset()}}}}else if((!$||r.mixedModules)&&(p.type==="FunctionDeclaration"||p.type==="FunctionExpression"||p.type==="ArrowFunctionExpression")&&(p.arguments||p.params)[0]&&(p.arguments||p.params)[0].type==="Identifier"){let e;let t;if((p.type==="ArrowFunctionExpression"||p.type==="FunctionExpression")&&h&&h.type==="VariableDeclarator"&&h.id.type==="Identifier"){e=h.id;t=p.arguments||p.params}else if(p.id){e=p.id;t=p.arguments||p.params}if(e&&p.body.body){let r,a=false;for(let e=0;ee&&e.id&&e.id.type==="Identifier"&&e.init&&e.init.type==="CallExpression"&&e.init.callee.type==="Identifier"&&e.init.callee.name==="require"&&Y.require.shadowDepth===0&&e.init.arguments[0]&&e.init.arguments[0].type==="Identifier"&&e.init.arguments[0].name===t[0].name))}if(r&&p.body.body[e].type==="ReturnStatement"&&p.body.body[e].argument&&p.body.body[e].argument.type==="Identifier"&&p.body.body[e].argument.name===r.id.name){a=true;break}}if(a)setKnownBinding(e.name,{value:K})}}},async leave(e,t){const r=e;const a=t;if(r.scope){if(J.parent){J=J.parent}for(const e in r.scope.declarations){if(e in Y){if(Y[e].shadowDepth>0)Y[e].shadowDepth--;else delete Y[e]}}}if(Q&&a)await backtrack(a,this)}});await A;return{assets:a,deps:c,imports:_,isESM:$};async function emitAssetPath(e){const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);try{var d=await r.stat(c);if(d===null){throw new Error("file not found")}}catch(e){return}if(t!==-1&&d.isFile())return;if(d.isFile()){a.add(e)}else if(d.isDirectory()){if(validWildcard(e))emitAssetDirectory(e)}}function validWildcard(t){let a="";if(t.endsWith(o.default.sep))a=o.default.sep;else if(t.endsWith(o.default.sep+u.WILDCARD))a=o.default.sep+u.WILDCARD;else if(t.endsWith(u.WILDCARD))a=u.WILDCARD;if(t===w+a)return false;if(t===q+a)return false;if(t.endsWith(o.default.sep+"node_modules"+a))return false;if(w.startsWith(t.substr(0,t.length-a.length)+o.default.sep))return false;if(k){const a=e.substr(0,e.indexOf(o.default.sep+"node_modules"))+o.default.sep+"node_modules"+o.default.sep;if(!t.startsWith(a)){if(r.log)console.log("Skipping asset emission of "+t.replace(u.wildcardRegEx,"*")+" for "+e+" as it is outside the package base "+k);return false}}return true}function resolveAbsolutePathOrUrl(e){return e instanceof x.URL?x.fileURLToPath(e):e.startsWith("file:")?x.fileURLToPath(new x.URL(e)):o.default.resolve(e)}async function emitStaticChildAsset(){if(!X){return}if("value"in X&&isAbsolutePathOrUrl(X.value)){try{const e=resolveAbsolutePathOrUrl(X.value);await emitAssetPath(e)}catch(e){}}else if("then"in X&&"else"in X&&isAbsolutePathOrUrl(X.then)&&isAbsolutePathOrUrl(X.else)){let e;try{e=resolveAbsolutePathOrUrl(X.then)}catch(e){}let t;try{t=resolveAbsolutePathOrUrl(X.else)}catch(e){}if(e)await emitAssetPath(e);if(t)await emitAssetPath(t)}else if(Q&&Q.type==="ArrayExpression"&&"value"in X&&X.value instanceof Array){for(const e of X.value){try{const t=resolveAbsolutePathOrUrl(e);await emitAssetPath(t)}catch(e){}}}Q=X=undefined}}t["default"]=analyze;function isAst(e){return"body"in e}},9582:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;Object.defineProperty(e,a,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!t.hasOwnProperty(r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});o(r(3864),t);var s=r(3471);Object.defineProperty(t,"nodeFileTrace",{enumerable:true,get:function(){return s.nodeFileTrace}})},3471:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Job=t.nodeFileTrace=void 0;const o=r(1017);const s=a(r(7147));const u=r(3837);const c=a(r(8827));const d=a(r(2278));const f=r(2540);const p=r(2985);const h=r(1017);const v=u.promisify(s.default.readFile);const _=u.promisify(s.default.readlink);const g=u.promisify(s.default.stat);const{gracefulify:y}=r(552);y(s.default);function inPath(e,t){const r=h.join(t,o.sep);return e.startsWith(r)&&e!==r}async function nodeFileTrace(e,t={}){const r=new Job(t);if(t.readFile)r.readFile=t.readFile;if(t.stat)r.stat=t.stat;if(t.readlink)r.readlink=t.readlink;if(t.resolve)r.resolve=t.resolve;r.ts=true;await Promise.all(e.map((async e=>{const t=o.resolve(e);await r.emitFile(t,"initial");if(t.endsWith(".js")||t.endsWith(".cjs")||t.endsWith(".mjs")||t.endsWith(".node")||r.ts&&(t.endsWith(".ts")||t.endsWith(".tsx"))){return r.emitDependency(t)}return undefined})));const a={fileList:r.fileList,esmFileList:r.esmFileList,reasons:r.reasons,warnings:r.warnings};return a}t.nodeFileTrace=nodeFileTrace;class Job{constructor({base:e=process.cwd(),processCwd:t,exports:r,conditions:a=r||["node"],exportsOnly:s=false,paths:u={},ignore:c,log:d=false,mixedModules:p=false,ts:h=true,analysis:v={},cache:_}){this.reasons=new Map;this.ts=h;e=o.resolve(e);this.ignoreFn=e=>{if(e.startsWith(".."+o.sep))return true;return false};if(typeof c==="string")c=[c];if(typeof c==="function"){const e=c;this.ignoreFn=t=>{if(t.startsWith(".."+o.sep))return true;if(e(t))return true;return false}}else if(Array.isArray(c)){const t=c.map((t=>o.relative(e,o.resolve(e||process.cwd(),t))));this.ignoreFn=e=>{if(e.startsWith(".."+o.sep))return true;if(f.isMatch(e,t))return true;return false}}this.base=e;this.cwd=o.resolve(t||e);this.conditions=a;this.exportsOnly=s;const g={};for(const t of Object.keys(u)){const r=u[t].endsWith("/");const a=o.resolve(e,u[t]);g[t]=a+(r?"/":"")}this.paths=g;this.log=d;this.mixedModules=p;this.analysis={};if(v!==false){Object.assign(this.analysis,{emitGlobs:true,computeFileReferences:true,evaluatePureExpressions:true},v===true?{}:v)}this.fileCache=_&&_.fileCache||new Map;this.statCache=_&&_.statCache||new Map;this.symlinkCache=_&&_.symlinkCache||new Map;this.analysisCache=_&&_.analysisCache||new Map;if(_){_.fileCache=this.fileCache;_.statCache=this.statCache;_.symlinkCache=this.symlinkCache;_.analysisCache=this.analysisCache}this.fileList=new Set;this.esmFileList=new Set;this.processed=new Set;this.warnings=new Set}async readlink(e){const t=this.symlinkCache.get(e);if(t!==undefined)return t;try{const t=await _(e);const r=this.statCache.get(e);if(r)this.statCache.set(o.resolve(e,t),r);this.symlinkCache.set(e,t);return t}catch(t){if(t.code!=="EINVAL"&&t.code!=="ENOENT"&&t.code!=="UNKNOWN")throw t;this.symlinkCache.set(e,null);return null}}async isFile(e){const t=await this.stat(e);if(t)return t.isFile();return false}async isDir(e){const t=await this.stat(e);if(t)return t.isDirectory();return false}async stat(e){const t=this.statCache.get(e);if(t)return t;try{const t=await g(e);this.statCache.set(e,t);return t}catch(t){if(t.code==="ENOENT"){this.statCache.set(e,null);return null}throw t}}async resolve(e,t,r,a){return d.default(e,t,r,a)}async readFile(e){const t=this.fileCache.get(e);if(t!==undefined)return t;try{const t=(await v(e)).toString();this.fileCache.set(e,t);return t}catch(t){if(t.code==="ENOENT"||t.code==="EISDIR"){this.fileCache.set(e,null);return null}throw t}}async realpath(e,t,r=new Set){if(r.has(e))throw new Error("Recursive symlink detected resolving "+e);r.add(e);const a=await this.readlink(e);if(a){const s=o.dirname(e);const u=o.resolve(s,a);const c=await this.realpath(s,t);if(inPath(e,c))await this.emitFile(e,"resolve",t,true);return this.realpath(u,t,r)}if(!inPath(e,this.base))return e;return h.join(await this.realpath(o.dirname(e),t,r),o.basename(e))}async emitFile(e,t,r,a=false){if(!a){e=await this.realpath(e,r)}e=o.relative(this.base,e);if(r){r=o.relative(this.base,r)}let s=this.reasons.get(e);if(!s){s={type:t,ignored:false,parents:new Set};this.reasons.set(e,s)}if(r&&this.ignoreFn(e,r)){if(!this.fileList.has(e)&&s){s.ignored=true}return false}if(r){s.parents.add(r)}this.fileList.add(e);return true}async getPjsonBoundary(e){const t=e.indexOf(o.sep);let r;while((r=e.lastIndexOf(o.sep))>t){e=e.substr(0,r);if(await this.isFile(e+o.sep+"package.json"))return e}return undefined}async emitDependency(e,t){if(this.processed.has(e)){if(t){await this.emitFile(e,"dependency",t)}return}this.processed.add(e);const r=await this.emitFile(e,"dependency",t);if(!r)return;if(e.endsWith(".json"))return;if(e.endsWith(".node"))return await p.sharedLibEmit(e,this);if(e.endsWith(".js")){const t=await this.getPjsonBoundary(e);if(t)await this.emitFile(t+o.sep+"package.json","resolve",e)}let a;const s=this.analysisCache.get(e);if(s){a=s}else{const t=await this.readFile(e);if(t===null)throw new Error("File "+e+" does not exist.");a=await c.default(e,t.toString(),this);this.analysisCache.set(e,a)}const{deps:u,imports:d,assets:f,isESM:h}=a;if(h)this.esmFileList.add(o.relative(this.base,e));await Promise.all([...[...f].map((async t=>{const r=o.extname(t);if(r===".js"||r===".mjs"||r===".node"||r===""||this.ts&&(r===".ts"||r===".tsx")&&t.startsWith(this.base)&&t.substr(this.base.length).indexOf(o.sep+"node_modules"+o.sep)===-1)await this.emitDependency(t,e);else await this.emitFile(t,"asset",e)})),...[...u].map((async t=>{try{var r=await this.resolve(t,e,this,!h)}catch(e){this.warnings.add(new Error(`Failed to resolve dependency ${t}:\n${e&&e.message}`));return}if(Array.isArray(r)){for(const t of r){if(t.startsWith("node:"))return;await this.emitDependency(t,e)}}else{if(r.startsWith("node:"))return;await this.emitDependency(r,e)}})),...[...d].map((async t=>{try{var r=await this.resolve(t,e,this,false)}catch(e){this.warnings.add(new Error(`Failed to resolve dependency ${t}:\n${e&&e.message}`));return}if(Array.isArray(r)){for(const t of r){if(t.startsWith("node:"))return;await this.emitDependency(t,e)}}else{if(r.startsWith("node:"))return;await this.emitDependency(r,e)}}))])}}t.Job=Job},2278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const a=r(1017);async function resolveDependency(e,t,r,o=true){let s;if(a.isAbsolute(e)||e==="."||e===".."||e.startsWith("./")||e.startsWith("../")){const o=e.endsWith("/");s=await resolvePath(a.resolve(t,"..",e)+(o?"/":""),t,r)}else if(e[0]==="#"){s=await packageImportsResolve(e,t,r,o)}else{s=await resolvePackage(e,t,r,o)}if(Array.isArray(s)){return Promise.all(s.map((e=>r.realpath(e,t))))}else if(s.startsWith("node:")){return s}else{return r.realpath(s,t)}}t["default"]=resolveDependency;async function resolvePath(e,t,r){const a=await resolveFile(e,t,r)||await resolveDir(e,t,r);if(!a){throw new NotFoundError(e,t)}return a}async function resolveFile(e,t,r){if(e.endsWith("/"))return undefined;e=await r.realpath(e,t);if(await r.isFile(e))return e;if(r.ts&&e.startsWith(r.base)&&e.substr(r.base.length).indexOf(a.sep+"node_modules"+a.sep)===-1&&await r.isFile(e+".ts"))return e+".ts";if(r.ts&&e.startsWith(r.base)&&e.substr(r.base.length).indexOf(a.sep+"node_modules"+a.sep)===-1&&await r.isFile(e+".tsx"))return e+".tsx";if(await r.isFile(e+".js"))return e+".js";if(await r.isFile(e+".json"))return e+".json";if(await r.isFile(e+".node"))return e+".node";return undefined}async function resolveDir(e,t,r){if(e.endsWith("/"))e=e.slice(0,-1);if(!await r.isDir(e))return;const o=await getPkgCfg(e,r);if(o&&typeof o.main==="string"){const s=await resolveFile(a.resolve(e,o.main),t,r)||await resolveFile(a.resolve(e,o.main,"index"),t,r);if(s){await r.emitFile(e+a.sep+"package.json","resolve",t);return s}}return resolveFile(a.resolve(e,"index"),t,r)}class NotFoundError extends Error{constructor(e,t){super("Cannot find module '"+e+"' loaded from "+t);this.code="MODULE_NOT_FOUND"}}const o=new Set([...r(8102)._builtinLibs,"constants","module","timers","console","_stream_writable","_stream_readable","_stream_duplex","process","sys"]);function getPkgName(e){const t=e.split("/");if(e[0]==="@"&&t.length>1)return t.length>1?t.slice(0,2).join("/"):null;return t.length?t[0]:null}async function getPkgCfg(e,t){const r=await t.readFile(e+a.sep+"package.json");if(r){try{return JSON.parse(r.toString())}catch(e){}}return undefined}function getExportsTarget(e,t,r){if(typeof e==="string"){return e}else if(e===null){return e}else if(Array.isArray(e)){for(const a of e){const e=getExportsTarget(a,t,r);if(e===null||typeof e==="string"&&e.startsWith("./"))return e}}else if(typeof e==="object"){for(const a of Object.keys(e)){if(a==="default"||a==="require"&&r||a==="import"&&!r||t.includes(a)){const o=getExportsTarget(e[a],t,r);if(o!==undefined)return o}}}return undefined}function resolveExportsImports(e,t,r,a,o,s){let u;if(o){if(!(typeof t==="object"&&!Array.isArray(t)&&t!==null))return undefined;u=t}else if(typeof t==="string"||Array.isArray(t)||t===null||typeof t==="object"&&Object.keys(t).length&&Object.keys(t)[0][0]!=="."){u={".":t}}else{u=t}if(r in u){const t=getExportsTarget(u[r],a.conditions,s);if(typeof t==="string"&&t.startsWith("./"))return e+t.slice(1)}for(const t of Object.keys(u).sort(((e,t)=>t.length-e.length))){if(t.endsWith("*")&&r.startsWith(t.slice(0,-1))){const o=getExportsTarget(u[t],a.conditions,s);if(typeof o==="string"&&o.startsWith("./"))return e+o.slice(1).replace(/\*/g,r.slice(t.length-1))}if(!t.endsWith("/"))continue;if(r.startsWith(t)){const o=getExportsTarget(u[t],a.conditions,s);if(typeof o==="string"&&o.endsWith("/")&&o.startsWith("./"))return e+o.slice(1)+r.slice(t.length)}}return undefined}async function packageImportsResolve(e,t,r,o){if(e!=="#"&&!e.startsWith("#/")&&r.conditions){const s=await r.getPjsonBoundary(t);if(s){const u=await getPkgCfg(s,r);const{imports:c}=u||{};if(u&&c!==null&&c!==undefined){let u=resolveExportsImports(s,c,e,r,true,o);if(u){if(o)u=await resolveFile(u,t,r)||await resolveDir(u,t,r);else if(!await r.isFile(u))throw new NotFoundError(u,t);if(u){await r.emitFile(s+a.sep+"package.json","resolve",t);return u}}}}}throw new NotFoundError(e,t)}async function resolvePackage(e,t,r,s){let u=t;if(o.has(e))return"node:"+e;const c=getPkgName(e)||"";let d;if(r.conditions){const o=await r.getPjsonBoundary(t);if(o){const u=await getPkgCfg(o,r);const{exports:f}=u||{};if(u&&u.name&&u.name===c&&f!==null&&f!==undefined){d=resolveExportsImports(o,f,"."+e.slice(c.length),r,false,s);if(d){if(s)d=await resolveFile(d,t,r)||await resolveDir(d,t,r);else if(!await r.isFile(d))throw new NotFoundError(d,t)}if(d)await r.emitFile(o+a.sep+"package.json","resolve",t)}}}let f;const p=u.indexOf(a.sep);while((f=u.lastIndexOf(a.sep))>p){u=u.substr(0,f);const o=u+a.sep+"node_modules";const p=await r.stat(o);if(!p||!p.isDirectory())continue;const h=await getPkgCfg(o+a.sep+c,r);const{exports:v}=h||{};if(r.conditions&&v!==undefined&&v!==null&&!d){let u;if(!r.exportsOnly)u=await resolveFile(o+a.sep+e,t,r)||await resolveDir(o+a.sep+e,t,r);let d=resolveExportsImports(o+a.sep+c,v,"."+e.slice(c.length),r,false,s);if(d){if(s)d=await resolveFile(d,t,r)||await resolveDir(d,t,r);else if(!await r.isFile(d))throw new NotFoundError(d,t)}if(d){await r.emitFile(o+a.sep+c+a.sep+"package.json","resolve",t);if(u&&u!==d)return[d,u];return d}if(u)return u}else{const s=await resolveFile(o+a.sep+e,t,r)||await resolveDir(o+a.sep+e,t,r);if(s){if(d&&d!==s)return[s,d];return s}}}if(d)return d;if(Object.hasOwnProperty.call(r.paths,e)){return r.paths[e]}for(const a of Object.keys(r.paths)){if(a.endsWith("/")&&e.startsWith(a)){const o=r.paths[a]+e.slice(a.length);const s=await resolveFile(o,t,r)||await resolveDir(o,t,r);if(!s){throw new NotFoundError(e,t)}return s}}throw new NotFoundError(e,t)}},3864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5078:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isLoop=t.isVarLoop=t.isIdentifierRead=void 0;function isIdentifierRead(e,t){switch(t.type){case"ObjectPattern":case"ArrayPattern":return false;case"AssignmentExpression":return t.right===e;case"MemberExpression":return t.computed||e===t.object;case"Property":return e===t.value;case"MethodDefinition":return false;case"VariableDeclarator":return t.id!==e;case"ExportSpecifier":return false;case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":return false;default:return true}}t.isIdentifierRead=isIdentifierRead;function isVarLoop(e){return e.type==="ForStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"}t.isVarLoop=isVarLoop;function isLoop(e){return e.type==="ForStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"||e.type==="WhileStatement"||e.type==="DoWhileStatement"}t.isLoop=isLoop},2774:function(__unused_webpack_module,exports,__nccwpck_require__){"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:true});exports.nbind=exports.pregyp=void 0;const path_1=__importDefault(__nccwpck_require__(1017));const fs_1=__importDefault(__nccwpck_require__(7147));const versioning=__nccwpck_require__(5574);const napi=__nccwpck_require__(9248);const pregypFind=(e,t)=>{const r=JSON.parse(fs_1.default.readFileSync(e).toString());versioning.validate_config(r,t);var a;if(napi.get_napi_build_versions(r,t)){a=napi.get_best_napi_build_version(r,t)}t=t||{};if(!t.module_root)t.module_root=path_1.default.dirname(e);var o=versioning.evaluate(r,t,a);return o.module};exports.pregyp={default:{find:pregypFind},find:pregypFind};function makeModulePathList(e,t){return[[e,t],[e,"build",t],[e,"build","Debug",t],[e,"build","Release",t],[e,"out","Debug",t],[e,"Debug",t],[e,"out","Release",t],[e,"Release",t],[e,"build","default",t],[e,process.env["NODE_BINDINGS_COMPILED_DIR"]||"compiled",process.versions.node,process.platform,process.arch,t]]}function findCompiledModule(basePath,specList){var resolvedList=[];var ext=path_1.default.extname(basePath);for(var _i=0,specList_1=specList;_i{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPackageName=t.getPackageBase=void 0;const r=/^(@[^\\\/]+[\\\/])?[^\\\/]+/;function getPackageBase(e){const t=e.lastIndexOf("node_modules");if(t!==-1&&(e[t-1]==="/"||e[t-1]==="\\")&&(e[t+12]==="/"||e[t+12]==="\\")){const a=e.substr(t+13).match(r);if(a)return e.substr(0,t+13+a[0].length)}return undefined}t.getPackageBase=getPackageBase;function getPackageName(e){const t=e.lastIndexOf("node_modules");if(t!==-1&&(e[t-1]==="/"||e[t-1]==="\\")&&(e[t+12]==="/"||e[t+12]==="\\")){const a=e.substr(t+13).match(r);if(a&&a.length>0){return a[0].replace(/\\/g,"/")}}return undefined}t.getPackageName=getPackageName},216:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.normalizeWildcardRequire=t.normalizeDefaultRequire=void 0;function normalizeDefaultRequire(e){if(e&&e.__esModule)return e;return{default:e}}t.normalizeDefaultRequire=normalizeDefaultRequire;const r=Object.prototype.hasOwnProperty;function normalizeWildcardRequire(e){if(e&&e.__esModule)return e;const t={};for(const a in e){if(!r.call(e,a))continue;t[a]=e[a]}t["default"]=e;return t}t.normalizeWildcardRequire=normalizeWildcardRequire},2985:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.sharedLibEmit=void 0;const o=a(r(2037));const s=a(r(3535));const u=r(7468);let c="";switch(o.default.platform()){case"darwin":c="/**/*.@(dylib|so?(.*))";break;case"win32":c="/**/*.dll";break;default:c="/**/*.so?(.*)"}async function sharedLibEmit(e,t){const r=u.getPackageBase(e);if(!r)return;const a=await new Promise(((e,t)=>s.default(r+c,{ignore:r+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));await Promise.all(a.map((r=>t.emitFile(r,"sharedlib",e))))}t.sharedLibEmit=sharedLibEmit},5735:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=r(1017);const s=a(r(2278));const u=r(7468);const c=r(7147);const d={"@generated/photon"({id:e,emitAssetDirectory:t}){if(e.endsWith("@generated/photon/index.js")){t(o.resolve(o.dirname(e),"runtime/"))}},argon2({id:e,emitAssetDirectory:t}){if(e.endsWith("argon2/argon2.js")){t(o.resolve(o.dirname(e),"build","Release"));t(o.resolve(o.dirname(e),"prebuilds"));t(o.resolve(o.dirname(e),"lib","binding"))}},bull({id:e,emitAssetDirectory:t}){if(e.endsWith("bull/lib/commands/index.js")){t(o.resolve(o.dirname(e)))}},camaro({id:e,emitAsset:t}){if(e.endsWith("camaro/dist/camaro.js")){t(o.resolve(o.dirname(e),"camaro.wasm"))}},"google-gax"({id:e,ast:t,emitAssetDirectory:r}){if(e.endsWith("google-gax/build/src/grpc.js")){for(const a of t.body){if(a.type==="VariableDeclaration"&&a.declarations[0].id.type==="Identifier"&&a.declarations[0].id.name==="googleProtoFilesDir"){r(o.resolve(o.dirname(e),"../../../google-proto-files"))}}}},oracledb({id:e,ast:t,emitAsset:r}){if(e.endsWith("oracledb/lib/oracledb.js")){for(const a of t.body){if(a.type==="ForStatement"&&"body"in a.body&&a.body.body&&Array.isArray(a.body.body)&&a.body.body[0]&&a.body.body[0].type==="TryStatement"&&a.body.body[0].block.body[0]&&a.body.body[0].block.body[0].type==="ExpressionStatement"&&a.body.body[0].block.body[0].expression.type==="AssignmentExpression"&&a.body.body[0].block.body[0].expression.operator==="="&&a.body.body[0].block.body[0].expression.left.type==="Identifier"&&a.body.body[0].block.body[0].expression.left.name==="oracledbCLib"&&a.body.body[0].block.body[0].expression.right.type==="CallExpression"&&a.body.body[0].block.body[0].expression.right.callee.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.callee.name==="require"&&a.body.body[0].block.body[0].expression.right.arguments.length===1&&a.body.body[0].block.body[0].expression.right.arguments[0].type==="MemberExpression"&&a.body.body[0].block.body[0].expression.right.arguments[0].computed===true&&a.body.body[0].block.body[0].expression.right.arguments[0].object.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.arguments[0].object.name==="binaryLocations"&&a.body.body[0].block.body[0].expression.right.arguments[0].property.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.arguments[0].property.name==="i"){a.body.body[0].block.body[0].expression.right.arguments=[{type:"Literal",value:"_"}];const t=global._unit?"3.0.0":JSON.parse(c.readFileSync(e.slice(0,-15)+"package.json","utf8")).version;const s=Number(t.slice(0,t.indexOf(".")))>=4;const u="oracledb-"+(s?t:"abi"+process.versions.modules)+"-"+process.platform+"-"+process.arch+".node";r(o.resolve(e,"../../build/Release/"+u))}}}},"phantomjs-prebuilt"({id:e,emitAssetDirectory:t}){if(e.endsWith("phantomjs-prebuilt/lib/phantomjs.js")){t(o.resolve(o.dirname(e),"..","bin"))}},"remark-prism"({id:e,emitAssetDirectory:t}){const r="remark-prism/src/highlight.js";if(e.endsWith(r)){try{const a=e.slice(0,-r.length);t(o.resolve(a,"prismjs","components"))}catch(e){}}},semver({id:e,emitAsset:t}){if(e.endsWith("semver/index.js")){t(o.resolve(e.replace("index.js","preload.js")))}},"socket.io":async function({id:e,ast:t,job:r}){if(e.endsWith("socket.io/lib/index.js")){async function replaceResolvePathStatement(t){if(t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.operator==="="&&t.expression.right.type==="CallExpression"&&t.expression.right.callee.type==="Identifier"&&t.expression.right.callee.name==="read"&&t.expression.right.arguments.length>=1&&t.expression.right.arguments[0].type==="CallExpression"&&t.expression.right.arguments[0].callee.type==="Identifier"&&t.expression.right.arguments[0].callee.name==="resolvePath"&&t.expression.right.arguments[0].arguments.length===1&&t.expression.right.arguments[0].arguments[0].type==="Literal"){const a=t.expression.right.arguments[0].arguments[0].value;let u;try{const t=await s.default(String(a),e,r);if(typeof t==="string"){u=t}else{return undefined}}catch(e){return undefined}const c="/"+o.relative(o.dirname(e),u);t.expression.right.arguments[0]={type:"BinaryExpression",start:t.expression.right.arguments[0].start,end:t.expression.right.arguments[0].end,operator:"+",left:{type:"Identifier",name:"__dirname"},right:{type:"Literal",value:c,raw:JSON.stringify(c)}}}return undefined}for(const e of t.body){if(e.type==="ExpressionStatement"&&e.expression.type==="AssignmentExpression"&&e.expression.operator==="="&&e.expression.left.type==="MemberExpression"&&e.expression.left.object.type==="MemberExpression"&&e.expression.left.object.object.type==="Identifier"&&e.expression.left.object.object.name==="Server"&&e.expression.left.object.property.type==="Identifier"&&e.expression.left.object.property.name==="prototype"&&e.expression.left.property.type==="Identifier"&&e.expression.left.property.name==="serveClient"&&e.expression.right.type==="FunctionExpression"){for(const t of e.expression.right.body.body){if(t.type==="IfStatement"&&t.consequent&&"body"in t.consequent&&t.consequent.body){const e=t.consequent.body;let r=false;if(Array.isArray(e)&&e[0]&&e[0].type==="ExpressionStatement"){r=await replaceResolvePathStatement(e[0])}if(Array.isArray(e)&&e[1]&&e[1].type==="TryStatement"&&e[1].block.body&&e[1].block.body[0]){r=await replaceResolvePathStatement(e[1].block.body[0])||r}return}}}}}},typescript({id:e,emitAssetDirectory:t}){if(e.endsWith("typescript/lib/tsc.js")){t(o.resolve(e,"../"))}},"uglify-es"({id:e,emitAsset:t}){if(e.endsWith("uglify-es/tools/node.js")){t(o.resolve(e,"../../lib/utils.js"));t(o.resolve(e,"../../lib/ast.js"));t(o.resolve(e,"../../lib/parse.js"));t(o.resolve(e,"../../lib/transform.js"));t(o.resolve(e,"../../lib/scope.js"));t(o.resolve(e,"../../lib/output.js"));t(o.resolve(e,"../../lib/compress.js"));t(o.resolve(e,"../../lib/sourcemap.js"));t(o.resolve(e,"../../lib/mozilla-ast.js"));t(o.resolve(e,"../../lib/propmangle.js"));t(o.resolve(e,"../../lib/minify.js"));t(o.resolve(e,"../exports.js"))}},"uglify-js"({id:e,emitAsset:t,emitAssetDirectory:r}){if(e.endsWith("uglify-js/tools/node.js")){r(o.resolve(e,"../../lib"));t(o.resolve(e,"../exports.js"))}},"playwright-core"({id:e,emitAsset:t}){if(e.endsWith("playwright-core/index.js")){t(o.resolve(o.dirname(e),"browsers.json"))}},"geo-tz"({id:e,emitAsset:t}){if(e.endsWith("geo-tz/dist/geo-tz.js")){t(o.resolve(o.dirname(e),"../data/geo.dat"))}}};async function handleSpecialCases({id:e,ast:t,emitAsset:r,emitAssetDirectory:a,job:o}){const s=u.getPackageName(e);const c=d[s||""];e=e.replace(/\\/g,"/");if(c)await c({id:e,ast:t,emitAsset:r,emitAssetDirectory:a,job:o})}t["default"]=handleSpecialCases},5401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.wildcardRegEx=t.WILDCARD=t.FUNCTION=t.UNKNOWN=t.evaluate=void 0;const a=r(7310);async function evaluate(e,t={},r=true){const a={computeBranches:r,vars:t};return walk(e);function walk(e){const t=o[e.type];if(t){return t.call(a,e,walk)}return undefined}}t.evaluate=evaluate;t.UNKNOWN=Symbol();t.FUNCTION=Symbol();t.WILDCARD="";t.wildcardRegEx=/\x1a/g;function countWildcards(e){t.wildcardRegEx.lastIndex=0;let r=0;while(t.wildcardRegEx.exec(e))r++;return r}const o={ArrayExpression:async function ArrayExpression(e,t){const r=[];for(let a=0,o=e.elements.length;aa.value}}}return undefined},BinaryExpression:async function BinaryExpression(e,r){const a=e.operator;let o=await r(e.left);if(!o&&a!=="+")return;let s=await r(e.right);if(!o&&!s)return;if(!o){if(this.computeBranches&&s&&"value"in s&&typeof s.value==="string")return{value:t.WILDCARD+s.value,wildcards:[e.left,...s.wildcards||[]]};return}if(!s){if(this.computeBranches&&a==="+"){if(o&&"value"in o&&typeof o.value==="string")return{value:o.value+t.WILDCARD,wildcards:[...o.wildcards||[],e.right]}}if(!("test"in o)&&a==="||"&&o.value)return o;return}if("test"in o&&"value"in s){const e=s.value;if(a==="==")return{test:o.test,then:o.then==e,else:o.else==e};if(a==="===")return{test:o.test,then:o.then===e,else:o.else===e};if(a==="!=")return{test:o.test,then:o.then!=e,else:o.else!=e};if(a==="!==")return{test:o.test,then:o.then!==e,else:o.else!==e};if(a==="+")return{test:o.test,then:o.then+e,else:o.else+e};if(a==="-")return{test:o.test,then:o.then-e,else:o.else-e};if(a==="*")return{test:o.test,then:o.then*e,else:o.else*e};if(a==="/")return{test:o.test,then:o.then/e,else:o.else/e};if(a==="%")return{test:o.test,then:o.then%e,else:o.else%e};if(a==="<")return{test:o.test,then:o.then")return{test:o.test,then:o.then>e,else:o.else>e};if(a===">=")return{test:o.test,then:o.then>=e,else:o.else>=e};if(a==="|")return{test:o.test,then:o.then|e,else:o.else|e};if(a==="&")return{test:o.test,then:o.then&e,else:o.else&e};if(a==="^")return{test:o.test,then:o.then^e,else:o.else^e};if(a==="&&")return{test:o.test,then:o.then&&e,else:o.else&&e};if(a==="||")return{test:o.test,then:o.then||e,else:o.else||e}}else if("test"in s&&"value"in o){const e=o.value;if(a==="==")return{test:s.test,then:e==s.then,else:e==s.else};if(a==="===")return{test:s.test,then:e===s.then,else:e===s.else};if(a==="!=")return{test:s.test,then:e!=s.then,else:e!=s.else};if(a==="!==")return{test:s.test,then:e!==s.then,else:e!==s.else};if(a==="+")return{test:s.test,then:e+s.then,else:e+s.else};if(a==="-")return{test:s.test,then:e-s.then,else:e-s.else};if(a==="*")return{test:s.test,then:e*s.then,else:e*s.else};if(a==="/")return{test:s.test,then:e/s.then,else:e/s.else};if(a==="%")return{test:s.test,then:e%s.then,else:e%s.else};if(a==="<")return{test:s.test,then:e")return{test:s.test,then:e>s.then,else:e>s.else};if(a===">=")return{test:s.test,then:e>=s.then,else:e>=s.else};if(a==="|")return{test:s.test,then:e|s.then,else:e|s.else};if(a==="&")return{test:s.test,then:e&s.then,else:e&s.else};if(a==="^")return{test:s.test,then:e^s.then,else:e^s.else};if(a==="&&")return{test:s.test,then:e&&s.then,else:o&&s.else};if(a==="||")return{test:s.test,then:e||s.then,else:o||s.else}}else if("value"in o&&"value"in s){if(a==="==")return{value:o.value==s.value};if(a==="===")return{value:o.value===s.value};if(a==="!=")return{value:o.value!=s.value};if(a==="!==")return{value:o.value!==s.value};if(a==="+"){const e={value:o.value+s.value};let t=[];if("wildcards"in o&&o.wildcards){t=t.concat(o.wildcards)}if("wildcards"in s&&s.wildcards){t=t.concat(s.wildcards)}if(t.length>0){e.wildcards=t}return e}if(a==="-")return{value:o.value-s.value};if(a==="*")return{value:o.value*s.value};if(a==="/")return{value:o.value/s.value};if(a==="%")return{value:o.value%s.value};if(a==="<")return{value:o.value")return{value:o.value>s.value};if(a===">=")return{value:o.value>=s.value};if(a==="|")return{value:o.value|s.value};if(a==="&")return{value:o.value&s.value};if(a==="^")return{value:o.value^s.value};if(a==="&&")return{value:o.value&&s.value};if(a==="||")return{value:o.value||s.value}}return},CallExpression:async function CallExpression(e,r){var a;const o=await r(e.callee);if(!o||"test"in o)return;let s=o.value;if(typeof s==="object"&&s!==null)s=s[t.FUNCTION];if(typeof s!=="function")return;let u=null;if(e.callee.object){u=await r(e.callee.object);u=u&&"value"in u&&u.value?u.value:null}let c;let d=[];let f;let p=e.arguments.length>0&&((a=e.callee.property)===null||a===void 0?void 0:a.name)!=="concat";const h=[];for(let a=0,o=e.arguments.length;ah.push(e)))}else{if(!this.computeBranches)return;o={value:t.WILDCARD};h.push(e.arguments[a])}if("test"in o){if(h.length)return;if(c)return;c=o.test;f=d.concat([]);d.push(o.then);f.push(o.else)}else{d.push(o.value);if(f)f.push(o.value)}}if(p)return;try{const e=await s.apply(u,d);if(e===t.UNKNOWN)return;if(!c){if(h.length){if(typeof e!=="string"||countWildcards(e)!==h.length)return;return{value:e,wildcards:h}}return{value:e}}const r=await s.apply(u,f);if(e===t.UNKNOWN)return;return{test:c,then:e,else:r}}catch(e){return}},ConditionalExpression:async function ConditionalExpression(e,t){const r=await t(e.test);if(r&&"value"in r)return r.value?t(e.consequent):t(e.alternate);if(!this.computeBranches)return;const a=await t(e.consequent);if(!a||"wildcards"in a||"test"in a)return;const o=await t(e.alternate);if(!o||"wildcards"in o||"test"in o)return;return{test:e.test,then:a.value,else:o.value}},ExpressionStatement:async function ExpressionStatement(e,t){return t(e.expression)},Identifier:async function Identifier(e,t){if(Object.hasOwnProperty.call(this.vars,e.name))return this.vars[e.name];return undefined},Literal:async function Literal(e,t){return{value:e.value}},MemberExpression:async function MemberExpression(e,r){const a=await r(e.object);if(!a||"test"in a||typeof a.value==="function"){return undefined}if(e.property.type==="Identifier"){if(typeof a.value==="string"&&e.property.name==="concat"){return{value:{[t.FUNCTION]:(...e)=>a.value.concat(e)}}}if(typeof a.value==="object"&&a.value!==null){const o=a.value;if(e.computed){const s=await r(e.property);if(s&&"value"in s&&s.value){const e=o[s.value];if(e===t.UNKNOWN)return undefined;return{value:e}}if(!o[t.UNKNOWN]&&Object.keys(a).length===0){return{value:undefined}}}else if(e.property.name in o){const r=o[e.property.name];if(r===t.UNKNOWN)return undefined;return{value:r}}else if(o[t.UNKNOWN])return undefined}else{return{value:undefined}}}const o=await r(e.property);if(!o||"test"in o)return undefined;if(typeof a.value==="object"&&a.value!==null){if(o.value in a.value){const e=a.value[o.value];if(e===t.UNKNOWN)return undefined;return{value:e}}else if(a.value[t.UNKNOWN]){return undefined}}else{return{value:undefined}}return undefined},MetaProperty:async function MetaProperty(e){if(e.meta.name==="import"&&e.property.name==="meta")return{value:this.vars["import.meta"]};return undefined},NewExpression:async function NewExpression(e,t){const r=await t(e.callee);if(r&&"value"in r&&r.value===a.URL&&e.arguments.length){const r=await t(e.arguments[0]);if(!r)return undefined;let o=null;if(e.arguments[1]){o=await t(e.arguments[1]);if(!o||!("value"in o))return undefined}if("value"in r){if(o){try{return{value:new a.URL(r.value,o.value)}}catch(e){return undefined}}try{return{value:new a.URL(r.value)}}catch(e){return undefined}}else{const e=r.test;if(o){try{return{test:e,then:new a.URL(r.then,o.value),else:new a.URL(r.else,o.value)}}catch(e){return undefined}}try{return{test:e,then:new a.URL(r.then),else:new a.URL(r.else)}}catch(e){return undefined}}}return undefined},ObjectExpression:async function ObjectExpression(e,r){const a={};for(let o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.handleWrappers=void 0;const a=r(7470);function isUndefinedOrVoid(e){return e.type==="Identifier"&&e.name==="undefined"||e.type==="UnaryExpression"&&e.operator==="void"&&e.argument.type==="Literal"&&e.argument.value===0}function handleWrappers(e){var t;let r;if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="UnaryExpression"&&e.body[0].expression.operator==="!"&&e.body[0].expression.argument.type==="CallExpression"&&e.body[0].expression.argument.callee.type==="FunctionExpression"&&e.body[0].expression.argument.arguments.length===1)r=e.body[0].expression.argument;else if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="CallExpression"&&e.body[0].expression.callee.type==="FunctionExpression"&&(e.body[0].expression.arguments.length===1||e.body[0].expression.arguments.length===0))r=e.body[0].expression;else if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="AssignmentExpression"&&e.body[0].expression.left.type==="MemberExpression"&&e.body[0].expression.left.object.type==="Identifier"&&e.body[0].expression.left.object.name==="module"&&e.body[0].expression.left.property.type==="Identifier"&&e.body[0].expression.left.property.name==="exports"&&e.body[0].expression.right.type==="CallExpression"&&e.body[0].expression.right.callee.type==="FunctionExpression"&&e.body[0].expression.right.arguments.length===1)r=e.body[0].expression.right;if(r){let e;let o;if(r.arguments[0]&&r.arguments[0].type==="ConditionalExpression"&&r.arguments[0].test.type==="LogicalExpression"&&r.arguments[0].test.operator==="&&"&&r.arguments[0].test.left.type==="BinaryExpression"&&r.arguments[0].test.left.operator==="==="&&r.arguments[0].test.left.left.type==="UnaryExpression"&&r.arguments[0].test.left.left.operator==="typeof"&&"name"in r.arguments[0].test.left.left.argument&&r.arguments[0].test.left.left.argument.name==="define"&&r.arguments[0].test.left.right.type==="Literal"&&r.arguments[0].test.left.right.value==="function"&&r.arguments[0].test.right.type==="MemberExpression"&&r.arguments[0].test.right.object.type==="Identifier"&&r.arguments[0].test.right.property.type==="Identifier"&&r.arguments[0].test.right.property.name==="amd"&&r.arguments[0].test.right.computed===false&&r.arguments[0].alternate.type==="FunctionExpression"&&r.arguments[0].alternate.params.length===1&&r.arguments[0].alternate.params[0].type==="Identifier"&&r.arguments[0].alternate.body.body.length===1&&r.arguments[0].alternate.body.body[0].type==="ExpressionStatement"&&r.arguments[0].alternate.body.body[0].expression.type==="AssignmentExpression"&&r.arguments[0].alternate.body.body[0].expression.left.type==="MemberExpression"&&r.arguments[0].alternate.body.body[0].expression.left.object.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.left.object.name==="module"&&r.arguments[0].alternate.body.body[0].expression.left.property.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.left.property.name==="exports"&&r.arguments[0].alternate.body.body[0].expression.left.computed===false&&r.arguments[0].alternate.body.body[0].expression.right.type==="CallExpression"&&r.arguments[0].alternate.body.body[0].expression.right.callee.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.right.callee.name===r.arguments[0].alternate.params[0].name&&"body"in r.callee&&"body"in r.callee.body&&Array.isArray(r.callee.body.body)&&r.arguments[0].alternate.body.body[0].expression.right.arguments.length===1&&r.arguments[0].alternate.body.body[0].expression.right.arguments[0].type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.right.arguments[0].name==="require"){let e=r.callee.body.body;if(e[0].type==="ExpressionStatement"&&e[0].expression.type==="Literal"&&e[0].expression.value==="use strict"){e=e.slice(1)}if(e.length===1&&e[0].type==="ExpressionStatement"&&e[0].expression.type==="CallExpression"&&e[0].expression.callee.type==="Identifier"&&e[0].expression.callee.name===r.arguments[0].test.right.object.name&&e[0].expression.arguments.length===1&&e[0].expression.arguments[0].type==="FunctionExpression"&&e[0].expression.arguments[0].params.length===1&&e[0].expression.arguments[0].params[0].type==="Identifier"&&e[0].expression.arguments[0].params[0].name==="require"){const t=e[0].expression.arguments[0];t.params=[];try{delete t.scope.declarations.require}catch(e){}}}else if(r.arguments[0]&&r.arguments[0].type==="FunctionExpression"&&r.arguments[0].params.length===0&&(r.arguments[0].body.body.length===1||r.arguments[0].body.body.length===2&&r.arguments[0].body.body[0].type==="VariableDeclaration"&&r.arguments[0].body.body[0].declarations.length===3&&r.arguments[0].body.body[0].declarations.every((e=>e.init===null&&e.id.type==="Identifier")))&&r.arguments[0].body.body[r.arguments[0].body.body.length-1].type==="ReturnStatement"&&(e=r.arguments[0].body.body[r.arguments[0].body.body.length-1])&&((t=e.argument)===null||t===void 0?void 0:t.type)==="CallExpression"&&e.argument.arguments.length&&e.argument.arguments.every((e=>e&&e.type==="Literal"&&typeof e.value==="number"))&&e.argument.callee.type==="CallExpression"&&(e.argument.callee.callee.type==="FunctionExpression"||e.argument.callee.callee.type==="CallExpression"&&e.argument.callee.callee.callee.type==="FunctionExpression"&&e.argument.callee.callee.arguments.length===0)&&e.argument.callee.arguments.length===3&&e.argument.callee.arguments[0].type==="ObjectExpression"&&e.argument.callee.arguments[1].type==="ObjectExpression"&&e.argument.callee.arguments[2].type==="ArrayExpression"){const t=e.argument.callee.arguments[0].properties;const r={};if(t.every((e=>{if(e.type!=="Property"||e.computed!==false||e.key.type!=="Literal"||typeof e.key.value!=="number"||e.value.type!=="ArrayExpression"||e.value.elements.length!==2||!e.value.elements[0]||!e.value.elements[1]||e.value.elements[0].type!=="FunctionExpression"||e.value.elements[1].type!=="ObjectExpression"){return false}const t=e.value.elements[1].properties;for(const e of t){if(e.type!=="Property"||e.value.type!=="Identifier"&&e.value.type!=="Literal"&&!isUndefinedOrVoid(e.value)||!(e.key.type==="Literal"&&typeof e.key.value==="string"||e.key.type==="Identifier")||e.computed){return false}if(isUndefinedOrVoid(e.value)){if(e.key.type==="Identifier"){r[e.key.name]={type:"Literal",start:e.key.start,end:e.key.end,value:e.key.name,raw:JSON.stringify(e.key.name)}}else if(e.key.type==="Literal"){r[String(e.key.value)]=e.key}}}return true}))){const t=Object.keys(r);const a=e.argument.callee.arguments[1];a.properties=t.map((e=>({type:"Property",method:false,shorthand:false,computed:false,kind:"init",key:r[e],value:{type:"ObjectExpression",properties:[{type:"Property",kind:"init",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"exports"},value:{type:"CallExpression",optional:false,callee:{type:"Identifier",name:"require"},arguments:[r[e]]}}]}})))}}else if(r.arguments[0]&&r.arguments[0].type==="FunctionExpression"&&r.arguments[0].params.length===2&&r.arguments[0].params[0].type==="Identifier"&&r.arguments[0].params[1].type==="Identifier"&&"body"in r.callee&&"body"in r.callee.body&&Array.isArray(r.callee.body.body)&&r.callee.body.body.length===1){const e=r.callee.body.body[0];if(e.type==="IfStatement"&&e.test.type==="LogicalExpression"&&e.test.operator==="&&"&&e.test.left.type==="BinaryExpression"&&e.test.left.left.type==="UnaryExpression"&&e.test.left.left.operator==="typeof"&&e.test.left.left.argument.type==="Identifier"&&e.test.left.left.argument.name==="module"&&e.test.left.right.type==="Literal"&&e.test.left.right.value==="object"&&e.test.right.type==="BinaryExpression"&&e.test.right.left.type==="UnaryExpression"&&e.test.right.left.operator==="typeof"&&e.test.right.left.argument.type==="MemberExpression"&&e.test.right.left.argument.object.type==="Identifier"&&e.test.right.left.argument.object.name==="module"&&e.test.right.left.argument.property.type==="Identifier"&&e.test.right.left.argument.property.name==="exports"&&e.test.right.right.type==="Literal"&&e.test.right.right.value==="object"&&e.consequent.type==="BlockStatement"&&e.consequent.body.length>0){let t;if(e.consequent.body[0].type==="VariableDeclaration"&&e.consequent.body[0].declarations[0].init&&e.consequent.body[0].declarations[0].init.type==="CallExpression")t=e.consequent.body[0].declarations[0].init;else if(e.consequent.body[0].type==="ExpressionStatement"&&e.consequent.body[0].expression.type==="CallExpression")t=e.consequent.body[0].expression;else if(e.consequent.body[0].type==="ExpressionStatement"&&e.consequent.body[0].expression.type==="AssignmentExpression"&&e.consequent.body[0].expression.operator==="="&&e.consequent.body[0].expression.right.type==="CallExpression")t=e.consequent.body[0].expression.right;if(t&&t.callee.type==="Identifier"&&"params"in r.callee&&r.callee.params.length>0&&"name"in r.callee.params[0]&&t.callee.name===r.callee.params[0].name&&t.arguments.length===2&&t.arguments[0].type==="Identifier"&&t.arguments[0].name==="require"&&t.arguments[1].type==="Identifier"&&t.arguments[1].name==="exports"){const e=r.arguments[0];e.params=[];try{const t=e.scope;delete t.declarations.require;delete t.declarations.exports}catch(e){}}}}else if(r.callee.type==="FunctionExpression"&&r.callee.body.body.length>2&&r.callee.body.body[0].type==="VariableDeclaration"&&r.callee.body.body[0].declarations.length===1&&r.callee.body.body[0].declarations[0].type==="VariableDeclarator"&&r.callee.body.body[0].declarations[0].id.type==="Identifier"&&r.callee.body.body[0].declarations[0].init&&(r.callee.body.body[0].declarations[0].init.type==="ObjectExpression"&&r.callee.body.body[0].declarations[0].init.properties.length===0||r.callee.body.body[0].declarations[0].init.type==="CallExpression"&&r.callee.body.body[0].declarations[0].init.arguments.length===1)&&(r.callee.body.body[1]&&r.callee.body.body[1].type==="FunctionDeclaration"&&r.callee.body.body[1].params.length===1&&r.callee.body.body[1].body.body.length>=3||r.callee.body.body[2]&&r.callee.body.body[2].type==="FunctionDeclaration"&&r.callee.body.body[2].params.length===1&&r.callee.body.body[2].body.body.length>=3)&&(r.arguments[0]&&(r.arguments[0].type==="ArrayExpression"&&(o=r.arguments[0])&&r.arguments[0].elements.length>0&&r.arguments[0].elements.every((e=>e&&e.type==="FunctionExpression"))||r.arguments[0].type==="ObjectExpression"&&(o=r.arguments[0])&&r.arguments[0].properties&&r.arguments[0].properties.length>0&&r.arguments[0].properties.every((e=>e&&e.type==="Property"&&!e.computed&&e.key&&e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number")&&e.value&&e.value.type==="FunctionExpression"))))||r.arguments.length===0&&r.callee.type==="FunctionExpression"&&r.callee.params.length===0&&r.callee.body.type==="BlockStatement"&&r.callee.body.body.length>5&&r.callee.body.body[0].type==="VariableDeclaration"&&r.callee.body.body[0].declarations.length===1&&r.callee.body.body[0].declarations[0].id.type==="Identifier"&&r.callee.body.body[1].type==="ExpressionStatement"&&r.callee.body.body[1].expression.type==="AssignmentExpression"&&r.callee.body.body[2].type==="ExpressionStatement"&&r.callee.body.body[2].expression.type==="AssignmentExpression"&&r.callee.body.body[3].type==="ExpressionStatement"&&r.callee.body.body[3].expression.type==="AssignmentExpression"&&r.callee.body.body[3].expression.left.type==="MemberExpression"&&r.callee.body.body[3].expression.left.object.type==="Identifier"&&r.callee.body.body[3].expression.left.object.name===r.callee.body.body[0].declarations[0].id.name&&r.callee.body.body[3].expression.left.property.type==="Identifier"&&r.callee.body.body[3].expression.left.property.name==="modules"&&r.callee.body.body[3].expression.right.type==="ObjectExpression"&&r.callee.body.body[3].expression.right.properties.every((e=>e&&e.type==="Property"&&!e.computed&&e.key&&e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number")&&e.value&&e.value.type==="FunctionExpression"))&&(o=r.callee.body.body[3].expression.right)&&(r.callee.body.body[4].type==="VariableDeclaration"&&r.callee.body.body[4].declarations.length===1&&r.callee.body.body[4].declarations[0].init&&r.callee.body.body[4].declarations[0].init.type==="CallExpression"&&r.callee.body.body[4].declarations[0].init.callee.type==="Identifier"&&r.callee.body.body[4].declarations[0].init.callee.name==="require"||r.callee.body.body[5].type==="VariableDeclaration"&&r.callee.body.body[5].declarations.length===1&&r.callee.body.body[5].declarations[0].init&&r.callee.body.body[5].declarations[0].init.type==="CallExpression"&&r.callee.body.body[5].declarations[0].init.callee.type==="Identifier"&&r.callee.body.body[5].declarations[0].init.callee.name==="require")){const e=new Map;let t;if(o.type==="ArrayExpression")t=o.elements.filter((e=>(e===null||e===void 0?void 0:e.type)==="FunctionExpression")).map(((e,t)=>[String(t),e]));else t=o.properties.map((e=>[String(e.key.value),e.value]));for(const[r,a]of t){const t=a.body.body.length===1?a.body.body[0]:(a.body.body.length===2||a.body.body.length===3&&a.body.body[2].type==="EmptyStatement")&&a.body.body[0].type==="ExpressionStatement"&&a.body.body[0].expression.type==="Literal"&&a.body.body[0].expression.value==="use strict"?a.body.body[1]:null;if(t&&t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.operator==="="&&t.expression.left.type==="MemberExpression"&&t.expression.left.object.type==="Identifier"&&"params"in a&&a.params.length>0&&"name"in a.params[0]&&t.expression.left.object.name===a.params[0].name&&t.expression.left.property.type==="Identifier"&&t.expression.left.property.name==="exports"&&t.expression.right.type==="CallExpression"&&t.expression.right.callee.type==="Identifier"&&t.expression.right.callee.name==="require"&&t.expression.right.arguments.length===1&&t.expression.right.arguments[0].type==="Literal"){e.set(r,t.expression.right.arguments[0].value)}}for(const[,r]of t){if("params"in r&&r.params.length===3&&r.params[2].type==="Identifier"){const t=new Map;a.walk(r.body,{enter(a,o){const s=a;const u=o;if(s.type==="CallExpression"&&s.callee.type==="Identifier"&&"name"in r.params[2]&&s.callee.name===r.params[2].name&&s.arguments.length===1&&s.arguments[0].type==="Literal"){const r=e.get(String(s.arguments[0].value));if(r){const e={type:"CallExpression",optional:false,callee:{type:"Identifier",name:"require"},arguments:[{type:"Literal",value:r}]};const a=u;if("right"in a&&a.right===s){a.right=e}else if("left"in a&&a.left===s){a.left=e}else if("object"in a&&a.object===s){a.object=e}else if("callee"in a&&a.callee===s){a.callee=e}else if("arguments"in a&&a.arguments.some((e=>e===s))){a.arguments=a.arguments.map((t=>t===s?e:t))}else if("init"in a&&a.init===s){if(a.type==="VariableDeclarator"&&a.id.type==="Identifier")t.set(a.id.name,r);a.init=e}}}else if(s.type==="CallExpression"&&s.callee.type==="MemberExpression"&&s.callee.object.type==="Identifier"&&"name"in r.params[2]&&s.callee.object.name===r.params[2].name&&s.callee.property.type==="Identifier"&&s.callee.property.name==="n"&&s.arguments.length===1&&s.arguments[0].type==="Identifier"){if(u&&"init"in u&&u.init===s){const e=s.arguments[0];const t={type:"CallExpression",optional:false,callee:{type:"MemberExpression",computed:false,optional:false,object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"assign"}},arguments:[{type:"ArrowFunctionExpression",expression:true,params:[],body:e},{type:"ObjectExpression",properties:[{type:"Property",kind:"init",method:false,computed:false,shorthand:false,key:{type:"Identifier",name:"a"},value:e}]}]};u.init=t}}}})}}}}}t.handleWrappers=handleWrappers},5920:(e,t)=>{e.exports=t=abbrev.abbrev=abbrev;abbrev.monkeyPatch=monkeyPatch;function monkeyPatch(){Object.defineProperty(Array.prototype,"abbrev",{value:function(){return abbrev(this)},enumerable:false,configurable:true,writable:true});Object.defineProperty(Object.prototype,"abbrev",{value:function(){return abbrev(Object.keys(this))},enumerable:false,configurable:true,writable:true})}function abbrev(e){if(arguments.length!==1||!Array.isArray(e)){e=Array.prototype.slice.call(arguments,0)}for(var t=0,r=e.length,a=[];tt?1:-1}},5534:e=>{"use strict";function isArguments(e){return e!=null&&typeof e==="object"&&e.hasOwnProperty("callee")}var t={"*":{label:"any",check:function(){return true}},A:{label:"array",check:function(e){return Array.isArray(e)||isArguments(e)}},S:{label:"string",check:function(e){return typeof e==="string"}},N:{label:"number",check:function(e){return typeof e==="number"}},F:{label:"function",check:function(e){return typeof e==="function"}},O:{label:"object",check:function(e){return typeof e==="object"&&e!=null&&!t.A.check(e)&&!t.E.check(e)}},B:{label:"boolean",check:function(e){return typeof e==="boolean"}},E:{label:"error",check:function(e){return e instanceof Error}},Z:{label:"null",check:function(e){return e==null}}};function addSchema(e,t){var r=t[e.length]=t[e.length]||[];if(r.indexOf(e)===-1)r.push(e)}var r=e.exports=function(e,r){if(arguments.length!==2)throw wrongNumberOfArgs(["SA"],arguments.length);if(!e)throw missingRequiredArg(0,"rawSchemas");if(!r)throw missingRequiredArg(1,"args");if(!t.S.check(e))throw invalidType(0,["string"],e);if(!t.A.check(r))throw invalidType(1,["array"],r);var a=e.split("|");var o={};a.forEach((function(e){for(var r=0;r{"use strict";t.TrackerGroup=r(2952);t.Tracker=r(6189);t.TrackerStream=r(5849)},8313:(e,t,r)=>{"use strict";var a=r(2361).EventEmitter;var o=r(3837);var s=0;var u=e.exports=function(e){a.call(this);this.id=++s;this.name=e};o.inherits(u,a)},2952:(e,t,r)=>{"use strict";var a=r(3837);var o=r(8313);var s=r(6189);var u=r(5849);var c=e.exports=function(e){o.call(this,e);this.parentGroup=null;this.trackers=[];this.completion={};this.weight={};this.totalWeight=0;this.finished=false;this.bubbleChange=bubbleChange(this)};a.inherits(c,o);function bubbleChange(e){return function(t,r,a){e.completion[a.id]=r;if(e.finished)return;e.emit("change",t||e.name,e.completed(),e)}}c.prototype.nameInTree=function(){var e=[];var t=this;while(t){e.unshift(t.name);t=t.parentGroup}return e.join("/")};c.prototype.addUnit=function(e,t){if(e.addUnit){var r=this;while(r){if(e===r){throw new Error("Attempted to add tracker group "+e.name+" to tree that already includes it "+this.nameInTree(this))}r=r.parentGroup}e.parentGroup=this}this.weight[e.id]=t||1;this.totalWeight+=this.weight[e.id];this.trackers.push(e);this.completion[e.id]=e.completed();e.on("change",this.bubbleChange);if(!this.finished)this.emit("change",e.name,this.completion[e.id],e);return e};c.prototype.completed=function(){if(this.trackers.length===0)return 0;var e=1/this.totalWeight;var t=0;for(var r=0;r{"use strict";var a=r(3837);var o=r(675);var s=r(1722);var u=r(6189);var c=e.exports=function(e,t,r){o.Transform.call(this,r);this.tracker=new u(e,t);this.name=e;this.id=this.tracker.id;this.tracker.on("change",delegateChange(this))};a.inherits(c,o.Transform);function delegateChange(e){return function(t,r,a){e.emit("change",t,r,e)}}c.prototype._transform=function(e,t,r){this.tracker.completeWork(e.length?e.length:1);this.push(e);r()};c.prototype._flush=function(e){this.tracker.finish();e()};s(c.prototype,"tracker").method("completed").method("addWork").method("finish")},6189:(e,t,r)=>{"use strict";var a=r(3837);var o=r(8313);var s=e.exports=function(e,t){o.call(this,e);this.workDone=0;this.workTodo=t||0};a.inherits(s,o);s.prototype.completed=function(){return this.workTodo===0?0:this.workDone/this.workTodo};s.prototype.addWork=function(e){this.workTodo+=e;this.emit("change",this.name,this.completed(),this)};s.prototype.completeWork=function(e){this.workDone+=e;if(this.workDone>this.workTodo)this.workDone=this.workTodo;this.emit("change",this.name,this.completed(),this)};s.prototype.finish=function(){this.workTodo=this.workDone=1;this.emit("change",this.name,1,this)}},5706:(module,exports,__nccwpck_require__)=>{var fs=__nccwpck_require__(7147),path=__nccwpck_require__(1017),fileURLToPath=__nccwpck_require__(9001),join=path.join,dirname=path.dirname,exists=fs.accessSync&&function(e){try{fs.accessSync(e)}catch(e){return false}return true}||fs.existsSync||path.existsSync,defaults={arrow:process.env.NODE_BINDINGS_ARROW||" → ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function bindings(opts){if(typeof opts=="string"){opts={bindings:opts}}else if(!opts){opts={}}Object.keys(defaults).map((function(e){if(!(e in opts))opts[e]=defaults[e]}));if(!opts.module_root){opts.module_root=exports.getRoot(exports.getFileName())}if(path.extname(opts.bindings)!=".node"){opts.bindings+=".node"}var requireFunc=true?eval("require"):0;var tries=[],i=0,l=opts.try.length,n,b,err;for(;i{"use strict";e.exports=function(e,t){if(e===null||e===undefined){throw TypeError()}e=String(e);var r=e.length;var a=t?Number(t):0;if(Number.isNaN(a)){a=0}if(a<0||a>=r){return undefined}var o=e.charCodeAt(a);if(o>=55296&&o<=56319&&r>a+1){var s=e.charCodeAt(a+1);if(s>=56320&&s<=57343){return(o-55296)*1024+s-56320+65536}}return o}},6322:(e,t)=>{"use strict";var r="[";t.up=function up(e){return r+(e||"")+"A"};t.down=function down(e){return r+(e||"")+"B"};t.forward=function forward(e){return r+(e||"")+"C"};t.back=function back(e){return r+(e||"")+"D"};t.nextLine=function nextLine(e){return r+(e||"")+"E"};t.previousLine=function previousLine(e){return r+(e||"")+"F"};t.horizontalAbsolute=function horizontalAbsolute(e){if(e==null)throw new Error("horizontalAboslute requires a column to position to");return r+e+"G"};t.eraseData=function eraseData(){return r+"J"};t.eraseLine=function eraseLine(){return r+"K"};t.goto=function(e,t){return r+t+";"+e+"H"};t.gotoSOL=function(){return"\r"};t.beep=function(){return""};t.hideCursor=function hideCursor(){return r+"?25l"};t.showCursor=function showCursor(){return r+"?25h"};var a={reset:0,bold:1,italic:3,underline:4,inverse:7,stopBold:22,stopItalic:23,stopUnderline:24,stopInverse:27,white:37,black:30,blue:34,cyan:36,green:32,magenta:35,red:31,yellow:33,bgWhite:47,bgBlack:40,bgBlue:44,bgCyan:46,bgGreen:42,bgMagenta:45,bgRed:41,bgYellow:43,grey:90,brightBlack:90,brightRed:91,brightGreen:92,brightYellow:93,brightBlue:94,brightMagenta:95,brightCyan:96,brightWhite:97,bgGrey:100,bgBrightBlack:100,bgBrightRed:101,bgBrightGreen:102,bgBrightYellow:103,bgBrightBlue:104,bgBrightMagenta:105,bgBrightCyan:106,bgBrightWhite:107};t.color=function color(e){if(arguments.length!==1||!Array.isArray(e)){e=Array.prototype.slice.call(arguments)}return r+e.map(colorNameToCode).join(";")+"m"};function colorNameToCode(e){if(a[e]!=null)return a[e];throw new Error("Unknown color or style name: "+e)}},3487:(e,t)=>{function isArray(e){if(Array.isArray){return Array.isArray(e)}return objectToString(e)==="[object Array]"}t.isArray=isArray;function isBoolean(e){return typeof e==="boolean"}t.isBoolean=isBoolean;function isNull(e){return e===null}t.isNull=isNull;function isNullOrUndefined(e){return e==null}t.isNullOrUndefined=isNullOrUndefined;function isNumber(e){return typeof e==="number"}t.isNumber=isNumber;function isString(e){return typeof e==="string"}t.isString=isString;function isSymbol(e){return typeof e==="symbol"}t.isSymbol=isSymbol;function isUndefined(e){return e===void 0}t.isUndefined=isUndefined;function isRegExp(e){return objectToString(e)==="[object RegExp]"}t.isRegExp=isRegExp;function isObject(e){return typeof e==="object"&&e!==null}t.isObject=isObject;function isDate(e){return objectToString(e)==="[object Date]"}t.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}t.isError=isError;function isFunction(e){return typeof e==="function"}t.isFunction=isFunction;function isPrimitive(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}t.isPrimitive=isPrimitive;t.isBuffer=Buffer.isBuffer;function objectToString(e){return Object.prototype.toString.call(e)}},1722:e=>{e.exports=Delegator;function Delegator(e,t){if(!(this instanceof Delegator))return new Delegator(e,t);this.proto=e;this.target=t;this.methods=[];this.getters=[];this.setters=[];this.fluents=[]}Delegator.prototype.method=function(e){var t=this.proto;var r=this.target;this.methods.push(e);t[e]=function(){return this[r][e].apply(this[r],arguments)};return this};Delegator.prototype.access=function(e){return this.getter(e).setter(e)};Delegator.prototype.getter=function(e){var t=this.proto;var r=this.target;this.getters.push(e);t.__defineGetter__(e,(function(){return this[r][e]}));return this};Delegator.prototype.setter=function(e){var t=this.proto;var r=this.target;this.setters.push(e);t.__defineSetter__(e,(function(t){return this[r][e]=t}));return this};Delegator.prototype.fluent=function(e){var t=this.proto;var r=this.target;this.fluents.push(e);t[e]=function(t){if("undefined"!=typeof t){this[r][e]=t;return this}else{return this[r][e]}};return this}},2157:(e,t,r)=>{"use strict";var a=r(2037).platform();var o=r(2081).spawnSync;var s=r(7147).readdirSync;var u="glibc";var c="musl";var d={encoding:"utf8",env:process.env};if(!o){o=function(){return{status:126,stdout:"",stderr:""}}}function contains(e){return function(t){return t.indexOf(e)!==-1}}function versionFromMuslLdd(e){return e.split(/[\r\n]+/)[1].trim().split(/\s/)[1]}function safeReaddirSync(e){try{return s(e)}catch(e){}return[]}var f="";var p="";var h="";if(a==="linux"){var v=o("getconf",["GNU_LIBC_VERSION"],d);if(v.status===0){f=u;p=v.stdout.trim().split(" ")[1];h="getconf"}else{var _=o("ldd",["--version"],d);if(_.status===0&&_.stdout.indexOf(c)!==-1){f=c;p=versionFromMuslLdd(_.stdout);h="ldd"}else if(_.status===1&&_.stderr.indexOf(c)!==-1){f=c;p=versionFromMuslLdd(_.stderr);h="ldd"}else{var g=safeReaddirSync("/lib");if(g.some(contains("-linux-gnu"))){f=u;h="filesystem"}else if(g.some(contains("libc.musl-"))){f=c;h="filesystem"}else if(g.some(contains("ld-musl-"))){f=c;h="filesystem"}else{var y=safeReaddirSync("/usr/sbin");if(y.some(contains("glibc"))){f=u;h="filesystem"}}}}}var m=f!==""&&f!==u;e.exports={GLIBC:u,MUSL:c,family:f,version:p,method:h,isNonGlibcLinux:m}},9001:(e,t,r)=>{var a=r(1017).sep||"/";e.exports=fileUriToPath;function fileUriToPath(e){if("string"!=typeof e||e.length<=7||"file://"!=e.substring(0,7)){throw new TypeError("must pass in a file:// URI to convert to a file path")}var t=decodeURI(e.substring(7));var r=t.indexOf("/");var o=t.substring(0,r);var s=t.substring(r+1);if("localhost"==o)o="";if(o){o=a+a+o}s=s.replace(/^(.+)\|/,"$1:");if(a=="\\"){s=s.replace(/\//g,"\\")}if(/^.+\:/.test(s)){}else{s=a+s}return o+s}},1271:(e,t,r)=>{"use strict";var a=r(1021);var o=r(5791);e.exports={activityIndicator:function(e,t,r){if(e.spun==null)return;return a(t,e.spun)},progressbar:function(e,t,r){if(e.completed==null)return;return o(t,r,e.completed)}}},2479:(e,t,r)=>{"use strict";var a=r(3837);var o=t.User=function User(e){var t=new Error(e);Error.captureStackTrace(t,User);t.code="EGAUGE";return t};t.MissingTemplateValue=function MissingTemplateValue(e,t){var r=new o(a.format('Missing template value "%s"',e.type));Error.captureStackTrace(r,MissingTemplateValue);r.template=e;r.values=t;return r};t.Internal=function Internal(e){var t=new Error(e);Error.captureStackTrace(t,Internal);t.code="EGAUGEINTERNAL";return t}},3278:e=>{"use strict";e.exports=isWin32()||isColorTerm();function isWin32(){return process.platform==="win32"}function isColorTerm(){var e=/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i;return!!process.env.COLORTERM||e.test(process.env.TERM)}},6054:(e,t,r)=>{"use strict";var a=r(4708);var o=r(7963);var s=r(3278);var u=r(2028);var c=r(7987);var d=r(75);var f=r(9186);var p=r(6401);e.exports=Gauge;function callWith(e,t){return function(){return t.call(e)}}function Gauge(e,t){var r,o;if(e&&e.write){o=e;r=t||{}}else if(t&&t.write){o=t;r=e||{}}else{o=f.stderr;r=e||t||{}}this._status={spun:0,section:"",subsection:""};this._paused=false;this._disabled=true;this._showing=false;this._onScreen=false;this._needsRedraw=false;this._hideCursor=r.hideCursor==null?true:r.hideCursor;this._fixedFramerate=r.fixedFramerate==null?!/^v0\.8\./.test(f.version):r.fixedFramerate;this._lastUpdateAt=null;this._updateInterval=r.updateInterval==null?50:r.updateInterval;this._themes=r.themes||c;this._theme=r.theme;var s=this._computeTheme(r.theme);var u=r.template||[{type:"progressbar",length:20},{type:"activityIndicator",kerning:1,length:1},{type:"section",kerning:1,default:""},{type:"subsection",kerning:1,default:""}];this.setWriteTo(o,r.tty);var d=r.Plumbing||a;this._gauge=new d(s,u,this.getWidth());this._$$doRedraw=callWith(this,this._doRedraw);this._$$handleSizeChange=callWith(this,this._handleSizeChange);this._cleanupOnExit=r.cleanupOnExit==null||r.cleanupOnExit;this._removeOnExit=null;if(r.enabled||r.enabled==null&&this._tty&&this._tty.isTTY){this.enable()}else{this.disable()}}Gauge.prototype={};Gauge.prototype.isEnabled=function(){return!this._disabled};Gauge.prototype.setTemplate=function(e){this._gauge.setTemplate(e);if(this._showing)this._requestRedraw()};Gauge.prototype._computeTheme=function(e){if(!e)e={};if(typeof e==="string"){e=this._themes.getTheme(e)}else if(e&&(Object.keys(e).length===0||e.hasUnicode!=null||e.hasColor!=null)){var t=e.hasUnicode==null?o():e.hasUnicode;var r=e.hasColor==null?s:e.hasColor;e=this._themes.getDefault({hasUnicode:t,hasColor:r,platform:e.platform})}return e};Gauge.prototype.setThemeset=function(e){this._themes=e;this.setTheme(this._theme)};Gauge.prototype.setTheme=function(e){this._gauge.setTheme(this._computeTheme(e));if(this._showing)this._requestRedraw();this._theme=e};Gauge.prototype._requestRedraw=function(){this._needsRedraw=true;if(!this._fixedFramerate)this._doRedraw()};Gauge.prototype.getWidth=function(){return(this._tty&&this._tty.columns||80)-1};Gauge.prototype.setWriteTo=function(e,t){var r=!this._disabled;if(r)this.disable();this._writeTo=e;this._tty=t||e===f.stderr&&f.stdout.isTTY&&f.stdout||e.isTTY&&e||this._tty;if(this._gauge)this._gauge.setWidth(this.getWidth());if(r)this.enable()};Gauge.prototype.enable=function(){if(!this._disabled)return;this._disabled=false;if(this._tty)this._enableEvents();if(this._showing)this.show()};Gauge.prototype.disable=function(){if(this._disabled)return;if(this._showing){this._lastUpdateAt=null;this._showing=false;this._doRedraw();this._showing=true}this._disabled=true;if(this._tty)this._disableEvents()};Gauge.prototype._enableEvents=function(){if(this._cleanupOnExit){this._removeOnExit=u(callWith(this,this.disable))}this._tty.on("resize",this._$$handleSizeChange);if(this._fixedFramerate){this.redrawTracker=d(this._$$doRedraw,this._updateInterval);if(this.redrawTracker.unref)this.redrawTracker.unref()}};Gauge.prototype._disableEvents=function(){this._tty.removeListener("resize",this._$$handleSizeChange);if(this._fixedFramerate)clearInterval(this.redrawTracker);if(this._removeOnExit)this._removeOnExit()};Gauge.prototype.hide=function(e){if(this._disabled)return e&&f.nextTick(e);if(!this._showing)return e&&f.nextTick(e);this._showing=false;this._doRedraw();e&&p(e)};Gauge.prototype.show=function(e,t){this._showing=true;if(typeof e==="string"){this._status.section=e}else if(typeof e==="object"){var r=Object.keys(e);for(var a=0;a{"use strict";var a=r(8753);e.exports=function(e){if(a(e)){return false}if(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)){return true}return false}},5511:(e,t,r)=>{"use strict";var a=r(7518);var o=r(6708);var s=r(6062);e.exports=function(e){if(typeof e!=="string"||e.length===0){return 0}var t=0;e=a(e);for(var r=0;r=127&&u<=159){continue}if(u>=65536){r++}if(s(u)){t+=2}else{t++}}return t}},4708:(e,t,r)=>{"use strict";var a=r(6322);var o=r(4293);var s=r(5534);var u=e.exports=function(e,t,r){if(!r)r=80;s("OAN",[e,t,r]);this.showing=false;this.theme=e;this.width=r;this.template=t};u.prototype={};u.prototype.setTheme=function(e){s("O",[e]);this.theme=e};u.prototype.setTemplate=function(e){s("A",[e]);this.template=e};u.prototype.setWidth=function(e){s("N",[e]);this.width=e};u.prototype.hide=function(){return a.gotoSOL()+a.eraseLine()};u.prototype.hideCursor=a.hideCursor;u.prototype.showCursor=a.showCursor;u.prototype.show=function(e){var t=Object.create(this.theme);for(var r in e){t[r]=e[r]}return o(this.width,this.template,t).trim()+a.color("reset")+a.eraseLine()+a.gotoSOL()}},9186:e=>{"use strict";e.exports=process},5791:(e,t,r)=>{"use strict";var a=r(5534);var o=r(4293);var s=r(2343);var u=r(5511);e.exports=function(e,t,r){a("ONN",[e,t,r]);if(r<0)r=0;if(r>1)r=1;if(t<=0)return"";var s=Math.round(t*r);var u=t-s;var c=[{type:"complete",value:repeat(e.complete,s),length:s},{type:"remaining",value:repeat(e.remaining,u),length:u}];return o(t,c,e)};function repeat(e,t){var r="";var a=t;do{if(a%2){r+=e}a=Math.floor(a/2);e+=e}while(a&&u(r){"use strict";var a=r(7568);var o=r(5534);var s=r(1800);var u=r(2343);var c=r(2479);var d=r(5205);function renderValueWithValues(e){return function(t){return renderValue(t,e)}}var f=e.exports=function(e,t,r){var o=prepareItems(e,t,r);var s=o.map(renderValueWithValues(r)).join("");return a.left(u(s,e),e)};function preType(e){var t=e.type[0].toUpperCase()+e.type.slice(1);return"pre"+t}function postType(e){var t=e.type[0].toUpperCase()+e.type.slice(1);return"post"+t}function hasPreOrPost(e,t){if(!e.type)return;return t[preType(e)]||t[postType(e)]}function generatePreAndPost(e,t){var r=s({},e);var a=Object.create(t);var o=[];var u=preType(r);var c=postType(r);if(a[u]){o.push({value:a[u]});a[u]=null}r.minLength=null;r.length=null;r.maxLength=null;o.push(r);a[r.type]=a[r.type];if(a[c]){o.push({value:a[c]});a[c]=null}return function(e,t,r){return f(r,o,a)}}function prepareItems(e,t,r){function cloneAndObjectify(t,a,o){var s=new d(t,e);var u=s.type;if(s.value==null){if(!(u in r)){if(s.default==null){throw new c.MissingTemplateValue(s,r)}else{s.value=s.default}}else{s.value=r[u]}}if(s.value==null||s.value==="")return null;s.index=a;s.first=a===0;s.last=a===o.length-1;if(hasPreOrPost(s,r))s.value=generatePreAndPost(s,r);return s}var a=t.map(cloneAndObjectify).filter((function(e){return e!=null}));var o=0;var s=e;var u=a.length;function consumeSpace(e){if(e>s)e=s;o+=e;s-=e}function finishSizing(e,t){if(e.finished)throw new c.Internal("Tried to finish template item that was already finished");if(t===Infinity)throw new c.Internal("Length of template item cannot be infinity");if(t!=null)e.length=t;e.minLength=null;e.maxLength=null;--u;e.finished=true;if(e.length==null)e.length=e.getBaseLength();if(e.length==null)throw new c.Internal("Finished template items must have a length");consumeSpace(e.getLength())}a.forEach((function(e){if(!e.kerning)return;var t=e.first?0:a[e.index-1].padRight;if(!e.first&&t=h){finishSizing(e,e.minLength);p=true}}))}while(p&&f++{"use strict";var a=r(9186);try{e.exports=setImmediate}catch(t){e.exports=a.nextTick}},75:e=>{"use strict";e.exports=setInterval},1021:e=>{"use strict";e.exports=function spin(e,t){return e[t%e.length]}},5205:(e,t,r)=>{"use strict";var a=r(5511);e.exports=TemplateItem;function isPercent(e){if(typeof e!=="string")return false;return e.slice(-1)==="%"}function percent(e){return Number(e.slice(0,-1))/100}function TemplateItem(e,t){this.overallOutputLength=t;this.finished=false;this.type=null;this.value=null;this.length=null;this.maxLength=null;this.minLength=null;this.kerning=null;this.align="left";this.padLeft=0;this.padRight=0;this.index=null;this.first=null;this.last=null;if(typeof e==="string"){this.value=e}else{for(var r in e)this[r]=e[r]}if(isPercent(this.length)){this.length=Math.round(this.overallOutputLength*percent(this.length))}if(isPercent(this.minLength)){this.minLength=Math.round(this.overallOutputLength*percent(this.minLength))}if(isPercent(this.maxLength)){this.maxLength=Math.round(this.overallOutputLength*percent(this.maxLength))}return this}TemplateItem.prototype={};TemplateItem.prototype.getBaseLength=function(){var e=this.length;if(e==null&&typeof this.value==="string"&&this.maxLength==null&&this.minLength==null){e=a(this.value)}return e};TemplateItem.prototype.getLength=function(){var e=this.getBaseLength();if(e==null)return null;return e+this.padLeft+this.padRight};TemplateItem.prototype.getMaxLength=function(){if(this.maxLength==null)return null;return this.maxLength+this.padLeft+this.padRight};TemplateItem.prototype.getMinLength=function(){if(this.minLength==null)return null;return this.minLength+this.padLeft+this.padRight}},3117:(e,t,r)=>{"use strict";var a=r(1800);e.exports=function(){return o.newThemeSet()};var o={};o.baseTheme=r(1271);o.newTheme=function(e,t){if(!t){t=e;e=this.baseTheme}return a({},e,t)};o.getThemeNames=function(){return Object.keys(this.themes)};o.addTheme=function(e,t,r){this.themes[e]=this.newTheme(t,r)};o.addToAllThemes=function(e){var t=this.themes;Object.keys(t).forEach((function(r){a(t[r],e)}));a(this.baseTheme,e)};o.getTheme=function(e){if(!this.themes[e])throw this.newMissingThemeError(e);return this.themes[e]};o.setDefault=function(e,t){if(t==null){t=e;e={}}var r=e.platform==null?"fallback":e.platform;var a=!!e.hasUnicode;var o=!!e.hasColor;if(!this.defaults[r])this.defaults[r]={true:{},false:{}};this.defaults[r][a][o]=t};o.getDefault=function(e){if(!e)e={};var t=e.platform||process.platform;var r=this.defaults[t]||this.defaults.fallback;var o=!!e.hasUnicode;var s=!!e.hasColor;if(!r)throw this.newMissingDefaultThemeError(t,o,s);if(!r[o][s]){if(o&&s&&r[!o][s]){o=false}else if(o&&s&&r[o][!s]){s=false}else if(o&&s&&r[!o][!s]){o=false;s=false}else if(o&&!s&&r[!o][s]){o=false}else if(!o&&s&&r[o][!s]){s=false}else if(r===this.defaults.fallback){throw this.newMissingDefaultThemeError(t,o,s)}}if(r[o][s]){return this.getTheme(r[o][s])}else{return this.getDefault(a({},e,{platform:"fallback"}))}};o.newMissingThemeError=function newMissingThemeError(e){var t=new Error('Could not find a gauge theme named "'+e+'"');Error.captureStackTrace.call(t,newMissingThemeError);t.theme=e;t.code="EMISSINGTHEME";return t};o.newMissingDefaultThemeError=function newMissingDefaultThemeError(e,t,r){var a=new Error("Could not find a gauge theme for your platform/unicode/color use combo:\n"+" platform = "+e+"\n"+" hasUnicode = "+t+"\n"+" hasColor = "+r);Error.captureStackTrace.call(a,newMissingDefaultThemeError);a.platform=e;a.hasUnicode=t;a.hasColor=r;a.code="EMISSINGTHEME";return a};o.newThemeSet=function(){var themeset=function(e){return themeset.getDefault(e)};return a(themeset,o,{themes:a({},this.themes),baseTheme:a({},this.baseTheme),defaults:JSON.parse(JSON.stringify(this.defaults||{}))})}},7987:(e,t,r)=>{"use strict";var a=r(6322);var o=r(3117);var s=e.exports=new o;s.addTheme("ASCII",{preProgressbar:"[",postProgressbar:"]",progressbarTheme:{complete:"#",remaining:"."},activityIndicatorTheme:"-\\|/",preSubsection:">"});s.addTheme("colorASCII",s.getTheme("ASCII"),{progressbarTheme:{preComplete:a.color("inverse"),complete:" ",postComplete:a.color("stopInverse"),preRemaining:a.color("brightBlack"),remaining:".",postRemaining:a.color("reset")}});s.addTheme("brailleSpinner",{preProgressbar:"⸨",postProgressbar:"⸩",progressbarTheme:{complete:"░",remaining:"⠂"},activityIndicatorTheme:"⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏",preSubsection:">"});s.addTheme("colorBrailleSpinner",s.getTheme("brailleSpinner"),{progressbarTheme:{preComplete:a.color("inverse"),complete:" ",postComplete:a.color("stopInverse"),preRemaining:a.color("brightBlack"),remaining:"░",postRemaining:a.color("reset")}});s.setDefault({},"ASCII");s.setDefault({hasColor:true},"colorASCII");s.setDefault({platform:"darwin",hasUnicode:true},"brailleSpinner");s.setDefault({platform:"darwin",hasUnicode:true,hasColor:true},"colorBrailleSpinner")},2343:(e,t,r)=>{"use strict";var a=r(5511);var o=r(7518);e.exports=wideTruncate;function wideTruncate(e,t){if(a(e)===0)return e;if(t<=0)return"";if(a(e)<=t)return e;var r=o(e);var s=e.length+r.length;var u=e.slice(0,t+s);while(a(u)>t){u=u.slice(0,-1)}return u}},9132:e=>{"use strict";e.exports=clone;function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var t={__proto__:e.__proto__};else var t=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}));return t}},552:(e,t,r)=>{var a=r(7147);var o=r(1290);var s=r(4410);var u=r(9132);var c=r(3837);var d;var f;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){d=Symbol.for("graceful-fs.queue");f=Symbol.for("graceful-fs.previous")}else{d="___graceful-fs.queue";f="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,d,{get:function(){return t}})}var p=noop;if(c.debuglog)p=c.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var e=c.format.apply(c,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!a[d]){var h=global[d]||[];publishQueue(a,h);a.close=function(e){function close(t,r){return e.call(a,t,(function(e){if(!e){retry()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,f,{value:e});return close}(a.close);a.closeSync=function(e){function closeSync(t){e.apply(a,arguments);retry()}Object.defineProperty(closeSync,f,{value:e});return closeSync}(a.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(a[d]);r(9491).equal(a[d].length,0)}))}}if(!global[d]){publishQueue(global,a[d])}e.exports=patch(u(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched){e.exports=patch(a);a.__patched=true}function patch(e){o(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,a){if(typeof r==="function")a=r,r=null;return go$readFile(e,r,a);function go$readFile(e,r,a){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,a]]);else{if(typeof a==="function")a.apply(this,arguments);retry()}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,a,o){if(typeof a==="function")o=a,a=null;return go$writeFile(e,t,a,o);function go$writeFile(e,t,a,o){return r(e,t,a,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,a,o]]);else{if(typeof o==="function")o.apply(this,arguments);retry()}}))}}var a=e.appendFile;if(a)e.appendFile=appendFile;function appendFile(e,t,r,o){if(typeof r==="function")o=r,r=null;return go$appendFile(e,t,r,o);function go$appendFile(e,t,r,o){return a(e,t,r,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,o]]);else{if(typeof o==="function")o.apply(this,arguments);retry()}}))}}var u=e.readdir;e.readdir=readdir;function readdir(e,t,r){var a=[e];if(typeof t!=="function"){a.push(t)}else{r=t}a.push(go$readdir$cb);return go$readdir(a);function go$readdir$cb(e,t){if(t&&t.sort)t.sort();if(e&&(e.code==="EMFILE"||e.code==="ENFILE"))enqueue([go$readdir,[a]]);else{if(typeof r==="function")r.apply(this,arguments);retry()}}}function go$readdir(t){return u.apply(e,t)}if(process.version.substr(0,4)==="v0.8"){var c=s(e);ReadStream=c.ReadStream;WriteStream=c.WriteStream}var d=e.ReadStream;if(d){ReadStream.prototype=Object.create(d.prototype);ReadStream.prototype.open=ReadStream$open}var f=e.WriteStream;if(f){WriteStream.prototype=Object.create(f.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var p=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return p},set:function(e){p=e},enumerable:true,configurable:true});var h=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return d.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return f.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var v=e.open;e.open=open;function open(e,t,r,a){if(typeof r==="function")a=r,r=null;return go$open(e,t,r,a);function go$open(e,t,r,a){return v(e,t,r,(function(o,s){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$open,[e,t,r,a]]);else{if(typeof a==="function")a.apply(this,arguments);retry()}}))}}return e}function enqueue(e){p("ENQUEUE",e[0].name,e[1]);a[d].push(e)}function retry(){var e=a[d].shift();if(e){p("RETRY",e[0].name,e[1]);e[0].apply(null,e[1])}}},4410:(e,t,r)=>{var a=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);a.call(this);var o=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var s=Object.keys(r);for(var u=0,c=s.length;uthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){o._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){o.emit("error",e);o.readable=false;return}o.fd=t;o.emit("open",t);o._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);a.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var o=Object.keys(r);for(var s=0,u=o.length;s= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},1290:(e,t,r)=>{var a=r(2057);var o=process.cwd;var s=null;var u=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!s)s=o.call(process);return s};try{process.cwd()}catch(e){}var c=process.chdir;process.chdir=function(e){s=null;c.call(process,e)};e.exports=patch;function patch(e){if(a.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,r,a){if(a)process.nextTick(a)};e.lchownSync=function(){}}if(u==="win32"){e.rename=function(t){return function(r,a,o){var s=Date.now();var u=0;t(r,a,(function CB(c){if(c&&(c.code==="EACCES"||c.code==="EPERM")&&Date.now()-s<6e4){setTimeout((function(){e.stat(a,(function(e,s){if(e&&e.code==="ENOENT")t(r,a,CB);else o(c)}))}),u);if(u<100)u+=10;return}if(o)o(c)}))}}(e.rename)}e.read=function(t){function read(r,a,o,s,u,c){var d;if(c&&typeof c==="function"){var f=0;d=function(p,h,v){if(p&&p.code==="EAGAIN"&&f<10){f++;return t.call(e,r,a,o,s,u,d)}c.apply(this,arguments)}}return t.call(e,r,a,o,s,u,d)}read.__proto__=t;return read}(e.read);e.readSync=function(t){return function(r,a,o,s,u){var c=0;while(true){try{return t.call(e,r,a,o,s,u)}catch(e){if(e.code==="EAGAIN"&&c<10){c++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,o){e.open(t,a.O_WRONLY|a.O_SYMLINK,r,(function(t,a){if(t){if(o)o(t);return}e.fchmod(a,r,(function(t){e.close(a,(function(e){if(o)o(t||e)}))}))}))};e.lchmodSync=function(t,r){var o=e.openSync(t,a.O_WRONLY|a.O_SYMLINK,r);var s=true;var u;try{u=e.fchmodSync(o,r);s=false}finally{if(s){try{e.closeSync(o)}catch(e){}}else{e.closeSync(o)}}return u}}function patchLutimes(e){if(a.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,r,o,s){e.open(t,a.O_SYMLINK,(function(t,a){if(t){if(s)s(t);return}e.futimes(a,r,o,(function(t){e.close(a,(function(e){if(s)s(t||e)}))}))}))};e.lutimesSync=function(t,r,o){var s=e.openSync(t,a.O_SYMLINK);var u;var c=true;try{u=e.futimesSync(s,r,o);c=false}finally{if(c){try{e.closeSync(s)}catch(e){}}else{e.closeSync(s)}}return u}}else{e.lutimes=function(e,t,r,a){if(a)process.nextTick(a)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,a,o){return t.call(e,r,a,(function(e){if(chownErOk(e))e=null;if(o)o.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,a){try{return t.call(e,r,a)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,a,o,s){return t.call(e,r,a,o,(function(e){if(chownErOk(e))e=null;if(s)s.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,a,o){try{return t.call(e,r,a,o)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,a,o){if(typeof a==="function"){o=a;a=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(o)o.apply(this,arguments)}return a?t.call(e,r,a,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,a){var o=a?t.call(e,r,a):t.call(e,r);if(o.uid<0)o.uid+=4294967296;if(o.gid<0)o.gid+=4294967296;return o}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},7963:(e,t,r)=>{"use strict";var a=r(2037);var o=e.exports=function(){if(a.type()=="Windows_NT"){return false}var e=/UTF-?8$/i;var t=process.env.LC_ALL||process.env.LC_CTYPE||process.env.LANG;return e.test(t)}},6919:(e,t,r)=>{try{var a=r(3837);if(typeof a.inherits!=="function")throw"";e.exports=a.inherits}catch(t){e.exports=r(7526)}},7526:e=>{if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},9842:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return t.call(e)=="[object Array]"}},3277:(module,__unused_webpack_exports,__nccwpck_require__)=>{var fs=__nccwpck_require__(7147);var path=__nccwpck_require__(1017);var os=__nccwpck_require__(2037);var runtimeRequire=true?eval("require"):0;var vars=process.config&&process.config.variables||{};var prebuildsOnly=!!process.env.PREBUILDS_ONLY;var abi=process.versions.modules;var runtime=isElectron()?"electron":"node";var arch=os.arch();var platform=os.platform();var libc=process.env.LIBC||(isAlpine(platform)?"musl":"glibc");var armv=process.env.ARM_VERSION||(arch==="arm64"?"8":vars.arm_version)||"";var uv=(process.versions.uv||"").split(".")[0];module.exports=load;function load(e){return runtimeRequire(load.path(e))}load.path=function(e){e=path.resolve(e||".");try{var t=runtimeRequire(path.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");if(process.env[t+"_PREBUILD"])e=process.env[t+"_PREBUILD"]}catch(e){}if(!prebuildsOnly){var r=getFirst(path.join(e,"build/Release"),matchBuild);if(r)return r;var a=getFirst(path.join(e,"build/Debug"),matchBuild);if(a)return a}var o=resolve(e);if(o)return o;var s=resolve(path.dirname(process.execPath));if(s)return s;var u=["platform="+platform,"arch="+arch,"runtime="+runtime,"abi="+abi,"uv="+uv,armv?"armv="+armv:"","libc="+libc,"node="+process.versions.node,process.versions&&process.versions.electron?"electron="+process.versions.electron:"",true?"webpack=true":0].filter(Boolean).join(" ");throw new Error("No native build was found for "+u+"\n loaded from: "+e+"\n");function resolve(e){var t=path.join(e,"prebuilds",platform+"-"+arch);var r=readdirSync(t).map(parseTags);var a=r.filter(matchTags(runtime,abi));var o=a.sort(compareTags(runtime))[0];if(o)return path.join(t,o.file)}};function readdirSync(e){try{return fs.readdirSync(e)}catch(e){return[]}}function getFirst(e,t){var r=readdirSync(e).filter(t);return r[0]&&path.join(e,r[0])}function matchBuild(e){return/\.node$/.test(e)}function parseTags(e){var t=e.split(".");var r=t.pop();var a={file:e,specificity:0};if(r!=="node")return;for(var o=0;or.specificity?-1:1}else{return 0}}}function isElectron(){if(process.versions&&process.versions.electron)return true;if(process.env.ELECTRON_RUN_AS_NODE)return true;return typeof window!=="undefined"&&window.process&&window.process.type==="renderer"}function isAlpine(e){return e==="linux"&&fs.existsSync("/etc/alpine-release")}load.parseTags=parseTags;load.matchTags=matchTags;load.compareTags=compareTags},9248:(e,t,r)=>{"use strict";var a=r(7147);var o=r(3632);var s=r(9658);e.exports=t;var u=process.version.substr(1).replace(/-.*$/,"").split(".").map((function(e){return+e}));var c=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];var d="napi_build_version=";e.exports.get_napi_version=function(e){var t=process.versions.napi;if(!t){if(u[0]===9&&u[1]>=3)t=2;else if(u[0]===8)t=1}return t};e.exports.get_napi_version_as_string=function(t){var r=e.exports.get_napi_version(t);return r?""+r:""};e.exports.validate_package_json=function(t,r){var a=t.binary;var o=pathOK(a.module_path);var s=pathOK(a.remote_path);var u=pathOK(a.package_name);var c=e.exports.get_napi_build_versions(t,r,true);var d=e.exports.get_napi_build_versions_raw(t);if(c){c.forEach((function(e){if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(c&&(!o||!s&&!u)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||s||u)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(c&&!e.exports.get_best_napi_build_version(t,r)&&e.exports.build_napi_only(t)){throw new Error("The N-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports N-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!c&&e.exports.build_napi_only(t)){throw new Error("The N-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports N-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,r,a){var o=[];var s=e.exports.get_napi_build_versions(t,r);a.forEach((function(a){if(s&&a.name==="install"){var u=e.exports.get_best_napi_build_version(t,r);var f=u?[d+u]:[];o.push({name:a.name,args:f})}else if(s&&c.indexOf(a.name)!==-1){s.forEach((function(e){var t=a.args.slice();t.push(d+e);o.push({name:a.name,args:t})}))}else{o.push(a)}}));return o};e.exports.get_napi_build_versions=function(t,r,a){var o=[];var u=e.exports.get_napi_version(r?r.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((function(e){var t=o.indexOf(e)!==-1;if(!t&&u&&e<=u){o.push(e)}else if(a&&!t&&u){s.info("This Node instance does not support builds for N-API version",e)}}))}if(r&&r["build-latest-napi-version-only"]){var c=0;o.forEach((function(e){if(e>c)c=e}));o=c?[c]:[]}return o.length?o:undefined};e.exports.get_napi_build_versions_raw=function(e){var t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((function(e){if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return d+e};e.exports.get_napi_build_version_from_command_args=function(e){for(var t=0;ta&&e<=s){a=e}}))}return a===0?undefined:a};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},5574:(e,t,r)=>{"use strict";e.exports=t;var a=r(1017);var o=r(7849);var s=r(7310);var u=r(2157);var c=r(9248);var d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=r(7316)}var f={};Object.keys(d).forEach((function(e){var t=e.split(".")[0];if(!f[t]){f[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}var r=o.parse(t);return e+"-v"+r.major+"."+r.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}var r=o.parse(t.node);if(r.major===0&&r.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{var r;if(d[t]){r=d[t]}else{var a=t.split(".").map((function(e){return+e}));if(a.length!=3){throw new Error("Unknown target version: "+t)}var o=a[0];var s=a[1];var u=a[2];if(o===1){while(true){if(s>0)--s;if(u>0)--u;var c=""+o+"."+s+"."+u;if(d[c]){r=d[c];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+c+" as ABI compatible target");break}if(s===0&&u===0){break}}}else if(o>=2){if(f[o]){r=d[f[o]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+f[o]+" as ABI compatible target")}}else if(o===0){if(a[1]%2===0){while(--u>0){var p=""+o+"."+s+"."+u;if(d[p]){r=d[p];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+p+" as ABI compatible target");break}}}}}if(!r){throw new Error("Unsupported target version: "+t)}var h={node:t,v8:r.v8+".0",modules:r.node_abi>1?r.node_abi:undefined};return get_node_abi(e,h)}}}e.exports.get_runtime_abi=get_runtime_abi;var p=["module_name","module_path","host"];function validate_config(e,t){var r=e.name+" package.json is not node-pre-gyp ready:\n";var a=[];if(!e.main){a.push("main")}if(!e.version){a.push("version")}if(!e.name){a.push("name")}if(!e.binary){a.push("binary")}var o=e.binary;p.forEach((function(e){if(a.indexOf("binary")>-1){a.pop("binary")}if(!o||o[e]===undefined||o[e]===""){a.push("binary."+e)}}));if(a.length>=1){throw new Error(r+"package.json must declare these properties: \n"+a.join("\n"))}if(o){var u=s.parse(o.host).protocol;if(u==="http:"){throw new Error("'host' protocol ("+u+") is invalid - only 'https:' is accepted")}}c.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((function(r){var a="{"+r+"}";while(e.indexOf(a)>-1){e=e.replace(a,t[r])}}));return e}function fix_slashes(e){if(e.slice(-1)!="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){var t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;var h="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";var v="";e.exports.evaluate=function(e,t,r){t=t||{};validate_config(e,t);var d=e.version;var f=o.parse(d);var p=t.runtime||get_process_runtime(process.versions);var _={name:e.name,configuration:Boolean(t.debug)?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:f.version,prerelease:f.prerelease.length?f.prerelease.join("."):"",build:f.build.length?f.build.join("."):"",major:f.major,minor:f.minor,patch:f.patch,runtime:p,node_abi:get_runtime_abi(p,t.target),node_abi_napi:c.get_napi_version(t.target)?"napi":get_runtime_abi(p,t.target),napi_version:c.get_napi_version(t.target),napi_build_version:r||"",node_napi_label:r?"napi-v"+r:get_runtime_abi(p,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||u.family||"unknown",module_main:e.main,toolset:t.toolset||""};var g=process.env["npm_config_"+_.module_name+"_binary_host_mirror"]||e.binary.host;_.host=fix_slashes(eval_template(g,_));_.module_path=eval_template(e.binary.module_path,_);if(t.module_root){_.module_path=a.join(t.module_root,_.module_path)}else{_.module_path=a.resolve(_.module_path)}_.module=a.join(_.module_path,_.module_name+".node");_.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,_))):v;var y=e.binary.package_name?e.binary.package_name:h;_.package_name=eval_template(y,_);_.staged_tarball=a.join("build/stage",_.remote_path,_.package_name);_.hosted_path=s.resolve(_.host,_.remote_path);_.hosted_tarball=s.resolve(_.hosted_path,_.package_name);return _}},3632:(e,t,r)=>{e.exports=rimraf;rimraf.sync=rimrafSync;var a=r(9491);var o=r(1017);var s=r(7147);var u=undefined;try{u=r(3535)}catch(e){}var c=parseInt("666",8);var d={nosort:true,silent:true};var f=0;var p=process.platform==="win32";function defaults(e){var t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((function(t){e[t]=e[t]||s[t];t=t+"Sync";e[t]=e[t]||s[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&u===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||d}function rimraf(e,t,r){if(typeof t==="function"){r=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof r,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);var o=0;var s=null;var c=0;if(t.disableGlob||!u.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,(function(r,a){if(!r)return afterGlob(null,[e]);u(e,t.glob,afterGlob)}));function next(e){s=s||e;if(--c===0)r(s)}function afterGlob(e,a){if(e)return r(e);c=a.length;if(c===0)return r();a.forEach((function(e){rimraf_(e,t,(function CB(r){if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&o{"use strict";var a=r(2717);var o=r(6054);var s=r(2361).EventEmitter;var u=t=e.exports=new s;var c=r(3837);var d=r(8834);var f=r(6322);d(true);var p=process.stderr;Object.defineProperty(u,"stream",{set:function(e){p=e;if(this.gauge)this.gauge.setWriteTo(p,p)},get:function(){return p}});var h;u.useColor=function(){return h!=null?h:p.isTTY};u.enableColor=function(){h=true;this.gauge.setTheme({hasColor:h,hasUnicode:v})};u.disableColor=function(){h=false;this.gauge.setTheme({hasColor:h,hasUnicode:v})};u.level="info";u.gauge=new o(p,{enabled:false,theme:{hasColor:u.useColor()},template:[{type:"progressbar",length:20},{type:"activityIndicator",kerning:1,length:1},{type:"section",default:""},":",{type:"logline",kerning:1,default:""}]});u.tracker=new a.TrackerGroup;u.progressEnabled=u.gauge.isEnabled();var v;u.enableUnicode=function(){v=true;this.gauge.setTheme({hasColor:this.useColor(),hasUnicode:v})};u.disableUnicode=function(){v=false;this.gauge.setTheme({hasColor:this.useColor(),hasUnicode:v})};u.setGaugeThemeset=function(e){this.gauge.setThemeset(e)};u.setGaugeTemplate=function(e){this.gauge.setTemplate(e)};u.enableProgress=function(){if(this.progressEnabled)return;this.progressEnabled=true;this.tracker.on("change",this.showProgress);if(this._pause)return;this.gauge.enable()};u.disableProgress=function(){if(!this.progressEnabled)return;this.progressEnabled=false;this.tracker.removeListener("change",this.showProgress);this.gauge.disable()};var _=["newGroup","newItem","newStream"];var mixinLog=function(e){Object.keys(u).forEach((function(t){if(t[0]==="_")return;if(_.filter((function(e){return e===t})).length)return;if(e[t])return;if(typeof u[t]!=="function")return;var r=u[t];e[t]=function(){return r.apply(u,arguments)}}));if(e instanceof a.TrackerGroup){_.forEach((function(t){var r=e[t];e[t]=function(){return mixinLog(r.apply(e,arguments))}}))}return e};_.forEach((function(e){u[e]=function(){return mixinLog(this.tracker[e].apply(this.tracker,arguments))}}));u.clearProgress=function(e){if(!this.progressEnabled)return e&&process.nextTick(e);this.gauge.hide(e)};u.showProgress=function(e,t){if(!this.progressEnabled)return;var r={};if(e)r.section=e;var a=u.record[u.record.length-1];if(a){r.subsection=a.prefix;var o=u.disp[a.level]||a.level;var s=this._format(o,u.style[a.level]);if(a.prefix)s+=" "+this._format(a.prefix,this.prefixStyle);s+=" "+a.message.split(/\r?\n/)[0];r.logline=s}r.completed=t||this.tracker.completed();this.gauge.show(r)}.bind(u);u.pause=function(){this._paused=true;if(this.progressEnabled)this.gauge.disable()};u.resume=function(){if(!this._paused)return;this._paused=false;var e=this._buffer;this._buffer=[];e.forEach((function(e){this.emitLog(e)}),this);if(this.progressEnabled)this.gauge.enable()};u._buffer=[];var g=0;u.record=[];u.maxRecordSize=1e4;u.log=function(e,t,r){var a=this.levels[e];if(a===undefined){return this.emit("error",new Error(c.format("Undefined log level: %j",e)))}var o=new Array(arguments.length-2);var s=null;for(var u=2;up/10){var v=Math.floor(p*.9);this.record=this.record.slice(-1*v)}this.emitLog(f)}.bind(u);u.emitLog=function(e){if(this._paused){this._buffer.push(e);return}if(this.progressEnabled)this.gauge.pulse(e.prefix);var t=this.levels[e.level];if(t===undefined)return;if(t0&&!isFinite(t))return;var r=u.disp[e.level]!=null?u.disp[e.level]:e.level;this.clearProgress();e.message.split(/\r?\n/).forEach((function(t){if(this.heading){this.write(this.heading,this.headingStyle);this.write(" ")}this.write(r,u.style[e.level]);var a=e.prefix||"";if(a)this.write(" ");this.write(a,this.prefixStyle);this.write(" "+t+"\n")}),this);this.showProgress()};u._format=function(e,t){if(!p)return;var r="";if(this.useColor()){t=t||{};var a=[];if(t.fg)a.push(t.fg);if(t.bg)a.push("bg"+t.bg[0].toUpperCase()+t.bg.slice(1));if(t.bold)a.push("bold");if(t.underline)a.push("underline");if(t.inverse)a.push("inverse");if(a.length)r+=f.color(a);if(t.beep)r+=f.beep()}r+=e;if(this.useColor()){r+=f.color("reset")}return r};u.write=function(e,t){if(!p)return;p.write(this._format(e,t))};u.addLevel=function(e,t,r,a){if(a==null)a=e;this.levels[e]=t;this.style[e]=r;if(!this[e]){this[e]=function(){var t=new Array(arguments.length+1);t[0]=e;for(var r=0;r{"use strict";e.exports=Number.isNaN||function(e){return e!==e}},1800:e=>{"use strict"; +(()=>{var __webpack_modules__={111:(e,t,r)=>{"use strict";e.exports=t;t.mockS3Http=r(7048).get_mockS3Http();t.mockS3Http("on");const a=t.mockS3Http("get");const o=r(7147);const s=r(1017);const u=r(1400);const c=r(9658);c.disableProgress();const d=r(5677);const f=r(2361).EventEmitter;const p=r(3837).inherits;const h=["clean","install","reinstall","build","rebuild","package","testpackage","publish","unpublish","info","testbinary","reveal","configure"];const v={};c.heading="node-pre-gyp";if(a){c.warn(`mocking s3 to ${process.env.node_pre_gyp_mock_s3}`)}Object.defineProperty(t,"find",{get:function(){return r(3093).find},enumerable:true});function Run({package_json_path:e="./package.json",argv:t}){this.package_json_path=e;this.commands={};const r=this;h.forEach((e=>{r.commands[e]=function(t,a){c.verbose("command",e,t);return require("./"+e)(r,t,a)}}));this.parseArgv(t);this.binaryHostSet=false}p(Run,f);t.Run=Run;const _=Run.prototype;_.package=r(9286);_.configDefs={help:Boolean,arch:String,debug:Boolean,directory:String,proxy:String,loglevel:String};_.shorthands={release:"--no-debug",C:"--directory",debug:"--debug",j:"--jobs",silent:"--loglevel=silent",silly:"--loglevel=silly",verbose:"--loglevel=verbose"};_.aliases=v;_.parseArgv=function parseOpts(e){this.opts=u(this.configDefs,this.shorthands,e);this.argv=this.opts.argv.remain.slice();const t=this.todo=[];e=this.argv.map((e=>{if(e in this.aliases){e=this.aliases[e]}return e}));e.slice().forEach((r=>{if(r in this.commands){const a=e.splice(0,e.indexOf(r));e.shift();if(t.length>0){t[t.length-1].args=a}t.push({name:r,args:[]})}}));if(t.length>0){t[t.length-1].args=e.splice(0)}let r=this.package_json_path;if(this.opts.directory){r=s.join(this.opts.directory,r)}this.package_json=JSON.parse(o.readFileSync(r));this.todo=d.expand_commands(this.package_json,this.opts,t);const a="npm_config_";Object.keys(process.env).forEach((e=>{if(e.indexOf(a)!==0)return;const t=process.env[e];if(e===a+"loglevel"){c.level=t}else{e=e.substring(a.length);if(e==="argv"){if(this.opts.argv&&this.opts.argv.remain&&this.opts.argv.remain.length){}else{this.opts[e]=t}}else{this.opts[e]=t}}}));if(this.opts.loglevel){c.level=this.opts.loglevel}c.resume()};_.setBinaryHostProperty=function(e){if(this.binaryHostSet){return this.package_json.binary.host}const t=this.package_json;if(!t||!t.binary||t.binary.host){return""}if(!t.binary.staging_host||!t.binary.production_host){return""}let r="production_host";if(e==="publish"){r="staging_host"}const a=process.env.node_pre_gyp_s3_host;if(a==="staging"||a==="production"){r=`${a}_host`}else if(this.opts["s3_host"]==="staging"||this.opts["s3_host"]==="production"){r=`${this.opts["s3_host"]}_host`}else if(this.opts["s3_host"]||a){throw new Error(`invalid s3_host ${this.opts["s3_host"]||a}`)}t.binary.host=t.binary[r];this.binaryHostSet=true;return t.binary.host};_.usage=function usage(){const e=[""," Usage: node-pre-gyp [options]",""," where is one of:",h.map((e=>" - "+e+" - "+require("./"+e).usage)).join("\n"),"","node-pre-gyp@"+this.version+" "+s.resolve(__dirname,".."),"node@"+process.versions.node].join("\n");return e};Object.defineProperty(_,"version",{get:function(){return this.package.version},enumerable:true})},3093:(e,t,r)=>{"use strict";const a=r(111);const o=r(302);const s=r(5677);const u=r(7147).existsSync||r(1017).existsSync;const c=r(1017);e.exports=t;t.usage="Finds the require path for the node-pre-gyp installed module";t.validate=function(e,t){o.validate_config(e,t)};t.find=function(e,t){if(!u(e)){throw new Error(e+"does not exist")}const r=new a.Run({package_json_path:e,argv:process.argv});r.setBinaryHostProperty();const d=r.package_json;o.validate_config(d,t);let f;if(s.get_napi_build_versions(d,t)){f=s.get_best_napi_build_version(d,t)}t=t||{};if(!t.module_root)t.module_root=c.dirname(e);const p=o.evaluate(d,t,f);return p.module}},5677:(e,t,r)=>{"use strict";const a=r(7147);e.exports=t;const o=process.version.substr(1).replace(/-.*$/,"").split(".").map((e=>+e));const s=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];const u="napi_build_version=";e.exports.get_napi_version=function(){let e=process.versions.napi;if(!e){if(o[0]===9&&o[1]>=3)e=2;else if(o[0]===8)e=1}return e};e.exports.get_napi_version_as_string=function(t){const r=e.exports.get_napi_version(t);return r?""+r:""};e.exports.validate_package_json=function(t,r){const a=t.binary;const o=pathOK(a.module_path);const s=pathOK(a.remote_path);const u=pathOK(a.package_name);const c=e.exports.get_napi_build_versions(t,r,true);const d=e.exports.get_napi_build_versions_raw(t);if(c){c.forEach((e=>{if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(c&&(!o||!s&&!u)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||s||u)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(c&&!e.exports.get_best_napi_build_version(t,r)&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!c&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,r,a){const o=[];const c=e.exports.get_napi_build_versions(t,r);a.forEach((a=>{if(c&&a.name==="install"){const s=e.exports.get_best_napi_build_version(t,r);const c=s?[u+s]:[];o.push({name:a.name,args:c})}else if(c&&s.indexOf(a.name)!==-1){c.forEach((e=>{const t=a.args.slice();t.push(u+e);o.push({name:a.name,args:t})}))}else{o.push(a)}}));return o};e.exports.get_napi_build_versions=function(t,a,o){const s=r(9658);let u=[];const c=e.exports.get_napi_version(a?a.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((e=>{const t=u.indexOf(e)!==-1;if(!t&&c&&e<=c){u.push(e)}else if(o&&!t&&c){s.info("This Node instance does not support builds for Node-API version",e)}}))}if(a&&a["build-latest-napi-version-only"]){let e=0;u.forEach((t=>{if(t>e)e=t}));u=e?[e]:[]}return u.length?u:undefined};e.exports.get_napi_build_versions_raw=function(e){const t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((e=>{if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return u+e};e.exports.get_napi_build_version_from_command_args=function(e){for(let t=0;t{if(e>a&&e<=t){a=e}}))}return a===0?undefined:a};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},7048:(e,t,r)=>{"use strict";e.exports=t;const a=r(7310);const o=r(7147);const s=r(1017);e.exports.detect=function(e,t){const r=e.hosted_path;const o=a.parse(r);t.prefix=!o.pathname||o.pathname==="/"?"":o.pathname.replace("/","");if(e.bucket&&e.region){t.bucket=e.bucket;t.region=e.region;t.endpoint=e.host;t.s3ForcePathStyle=e.s3ForcePathStyle}else{const e=o.hostname.split(".s3");const r=e[0];if(!r){return}if(!t.bucket){t.bucket=r}if(!t.region){const r=e[1].slice(1).split(".")[0];if(r==="amazonaws"){t.region="us-east-1"}else{t.region=r}}}};e.exports.get_s3=function(e){if(process.env.node_pre_gyp_mock_s3){const e=r(2722);const t=r(2037);e.config.basePath=`${t.tmpdir()}/mock`;const a=e.S3();const wcb=e=>(t,...r)=>{if(t&&t.code==="ENOENT"){t.code="NotFound"}return e(t,...r)};return{listObjects(e,t){return a.listObjects(e,wcb(t))},headObject(e,t){return a.headObject(e,wcb(t))},deleteObject(e,t){return a.deleteObject(e,wcb(t))},putObject(e,t){return a.putObject(e,wcb(t))}}}const t=r(918);t.config.update(e);const a=new t.S3;return{listObjects(e,t){return a.listObjects(e,t)},headObject(e,t){return a.headObject(e,t)},deleteObject(e,t){return a.deleteObject(e,t)},putObject(e,t){return a.putObject(e,t)}}};e.exports.get_mockS3Http=function(){let e=false;if(!process.env.node_pre_gyp_mock_s3){return()=>e}const t=r(3902);const a="https://mapbox-node-pre-gyp-public-testing-bucket.s3.us-east-1.amazonaws.com";const u=process.env.node_pre_gyp_mock_s3+"/mapbox-node-pre-gyp-public-testing-bucket";const mock_http=()=>{function get(e,t){const r=s.join(u,e.replace("%2B","+"));try{o.accessSync(r,o.constants.R_OK)}catch(e){return[404,"not found\n"]}return[200,o.createReadStream(r)]}return t(a).persist().get((()=>e)).reply(get)};mock_http(t,a,u);const mockS3Http=t=>{const r=e;if(t==="off"){e=false}else if(t==="on"){e=true}else if(t!=="get"){throw new Error(`illegal action for setMockHttp ${t}`)}return r};return mockS3Http}},302:(e,t,r)=>{"use strict";e.exports=t;const a=r(1017);const o=r(7849);const s=r(7310);const u=r(2157);const c=r(5677);let d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=r(2339)}const f={};Object.keys(d).forEach((e=>{const t=e.split(".")[0];if(!f[t]){f[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}const r=o.parse(t);return e+"-v"+r.major+"."+r.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}const r=o.parse(t.node);if(r.major===0&&r.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!=="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{let r;if(d[t]){r=d[t]}else{const e=t.split(".").map((e=>+e));if(e.length!==3){throw new Error("Unknown target version: "+t)}const a=e[0];let o=e[1];let s=e[2];if(a===1){while(true){if(o>0)--o;if(s>0)--s;const e=""+a+"."+o+"."+s;if(d[e]){r=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}if(o===0&&s===0){break}}}else if(a>=2){if(f[a]){r=d[f[a]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+f[a]+" as ABI compatible target")}}else if(a===0){if(e[1]%2===0){while(--s>0){const e=""+a+"."+o+"."+s;if(d[e]){r=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}}}}}if(!r){throw new Error("Unsupported target version: "+t)}const a={node:t,v8:r.v8+".0",modules:r.node_abi>1?r.node_abi:undefined};return get_node_abi(e,a)}}}e.exports.get_runtime_abi=get_runtime_abi;const p=["module_name","module_path","host"];function validate_config(e,t){const r=e.name+" package.json is not node-pre-gyp ready:\n";const a=[];if(!e.main){a.push("main")}if(!e.version){a.push("version")}if(!e.name){a.push("name")}if(!e.binary){a.push("binary")}const o=e.binary;if(o){p.forEach((e=>{if(!o[e]||typeof o[e]!=="string"){a.push("binary."+e)}}))}if(a.length>=1){throw new Error(r+"package.json must declare these properties: \n"+a.join("\n"))}if(o){const e=s.parse(o.host).protocol;if(e==="http:"){throw new Error("'host' protocol ("+e+") is invalid - only 'https:' is accepted")}}c.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((r=>{const a="{"+r+"}";while(e.indexOf(a)>-1){e=e.replace(a,t[r])}}));return e}function fix_slashes(e){if(e.slice(-1)!=="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){let t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;const h="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";const v="";e.exports.evaluate=function(e,t,r){t=t||{};validate_config(e,t);const d=e.version;const f=o.parse(d);const p=t.runtime||get_process_runtime(process.versions);const _={name:e.name,configuration:t.debug?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:f.version,prerelease:f.prerelease.length?f.prerelease.join("."):"",build:f.build.length?f.build.join("."):"",major:f.major,minor:f.minor,patch:f.patch,runtime:p,node_abi:get_runtime_abi(p,t.target),node_abi_napi:c.get_napi_version(t.target)?"napi":get_runtime_abi(p,t.target),napi_version:c.get_napi_version(t.target),napi_build_version:r||"",node_napi_label:r?"napi-v"+r:get_runtime_abi(p,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||u.family||"unknown",module_main:e.main,toolset:t.toolset||"",bucket:e.binary.bucket,region:e.binary.region,s3ForcePathStyle:e.binary.s3ForcePathStyle||false};const g=_.module_name.replace("-","_");const y=process.env["npm_config_"+g+"_binary_host_mirror"]||e.binary.host;_.host=fix_slashes(eval_template(y,_));_.module_path=eval_template(e.binary.module_path,_);if(t.module_root){_.module_path=a.join(t.module_root,_.module_path)}else{_.module_path=a.resolve(_.module_path)}_.module=a.join(_.module_path,_.module_name+".node");_.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,_))):v;const m=e.binary.package_name?e.binary.package_name:h;_.package_name=eval_template(m,_);_.staged_tarball=a.join("build/stage",_.remote_path,_.package_name);_.hosted_path=s.resolve(_.host,_.remote_path);_.hosted_tarball=s.resolve(_.hosted_path,_.package_name);return _}},1400:(e,t,r)=>{var a=process.env.DEBUG_NOPT||process.env.NOPT_DEBUG?function(){console.error.apply(console,arguments)}:function(){};var o=r(7310),s=r(1017),u=r(2781).Stream,c=r(5920),d=r(2037);e.exports=t=nopt;t.clean=clean;t.typeDefs={String:{type:String,validate:validateString},Boolean:{type:Boolean,validate:validateBoolean},url:{type:o,validate:validateUrl},Number:{type:Number,validate:validateNumber},path:{type:s,validate:validatePath},Stream:{type:u,validate:validateStream},Date:{type:Date,validate:validateDate}};function nopt(e,r,o,s){o=o||process.argv;e=e||{};r=r||{};if(typeof s!=="number")s=2;a(e,r,o,s);o=o.slice(s);var u={},c,d={remain:[],cooked:o,original:o.slice(0)};parse(o,u,d.remain,e,r);clean(u,e,t.typeDefs);u.argv=d;Object.defineProperty(u.argv,"toString",{value:function(){return this.original.map(JSON.stringify).join(" ")},enumerable:false});return u}function clean(e,r,o){o=o||t.typeDefs;var s={},u=[false,true,null,String,Array];Object.keys(e).forEach((function(c){if(c==="argv")return;var d=e[c],f=Array.isArray(d),p=r[c];if(!f)d=[d];if(!p)p=u;if(p===Array)p=u.concat(Array);if(!Array.isArray(p))p=[p];a("val=%j",d);a("types=",p);d=d.map((function(u){if(typeof u==="string"){a("string %j",u);u=u.trim();if(u==="null"&&~p.indexOf(null)||u==="true"&&(~p.indexOf(true)||~p.indexOf(Boolean))||u==="false"&&(~p.indexOf(false)||~p.indexOf(Boolean))){u=JSON.parse(u);a("jsonable %j",u)}else if(~p.indexOf(Number)&&!isNaN(u)){a("convert to number",u);u=+u}else if(~p.indexOf(Date)&&!isNaN(Date.parse(u))){a("convert to date",u);u=new Date(u)}}if(!r.hasOwnProperty(c)){return u}if(u===false&&~p.indexOf(null)&&!(~p.indexOf(false)||~p.indexOf(Boolean))){u=null}var d={};d[c]=u;a("prevalidated val",d,u,r[c]);if(!validate(d,c,u,r[c],o)){if(t.invalidHandler){t.invalidHandler(c,u,r[c],e)}else if(t.invalidHandler!==false){a("invalid: "+c+"="+u,r[c])}return s}a("validated val",d,u,r[c]);return d[c]})).filter((function(e){return e!==s}));if(!d.length&&p.indexOf(Array)===-1){a("VAL HAS NO LENGTH, DELETE IT",d,c,p.indexOf(Array));delete e[c]}else if(f){a(f,e[c],d);e[c]=d}else e[c]=d[0];a("k=%s val=%j",c,d,e[c])}))}function validateString(e,t,r){e[t]=String(r)}function validatePath(e,t,r){if(r===true)return false;if(r===null)return true;r=String(r);var a=process.platform==="win32",o=a?/^~(\/|\\)/:/^~\//,u=d.homedir();if(u&&r.match(o)){e[t]=s.resolve(u,r.substr(2))}else{e[t]=s.resolve(r)}return true}function validateNumber(e,t,r){a("validate Number %j %j %j",t,r,isNaN(r));if(isNaN(r))return false;e[t]=+r}function validateDate(e,t,r){var o=Date.parse(r);a("validate Date %j %j %j",t,r,o);if(isNaN(o))return false;e[t]=new Date(r)}function validateBoolean(e,t,r){if(r instanceof Boolean)r=r.valueOf();else if(typeof r==="string"){if(!isNaN(r))r=!!+r;else if(r==="null"||r==="false")r=false;else r=true}else r=!!r;e[t]=r}function validateUrl(e,t,r){r=o.parse(String(r));if(!r.host)return false;e[t]=r.href}function validateStream(e,t,r){if(!(r instanceof u))return false;e[t]=r}function validate(e,t,r,o,s){if(Array.isArray(o)){for(var u=0,c=o.length;u1){var _=h.indexOf("=");if(_>-1){v=true;var g=h.substr(_+1);h=h.substr(0,_);e.splice(p,1,h,g)}var y=resolveShort(h,s,f,d);a("arg=%j shRes=%j",h,y);if(y){a(h,y);e.splice.apply(e,[p,1].concat(y));if(h!==y[0]){p--;continue}}h=h.replace(/^-+/,"");var m=null;while(h.toLowerCase().indexOf("no-")===0){m=!m;h=h.substr(3)}if(d[h])h=d[h];var w=o[h];var x=Array.isArray(w);if(x&&w.length===1){x=false;w=w[0]}var E=w===Array||x&&w.indexOf(Array)!==-1;if(!o.hasOwnProperty(h)&&t.hasOwnProperty(h)){if(!Array.isArray(t[h]))t[h]=[t[h]];E=true}var S,k=e[p+1];var R=typeof m==="boolean"||w===Boolean||x&&w.indexOf(Boolean)!==-1||typeof w==="undefined"&&!v||k==="false"&&(w===null||x&&~w.indexOf(null));if(R){S=!m;if(k==="true"||k==="false"){S=JSON.parse(k);k=null;if(m)S=!S;p++}if(x&&k){if(~w.indexOf(k)){S=k;p++}else if(k==="null"&&~w.indexOf(null)){S=null;p++}else if(!k.match(/^-{2,}[^-]/)&&!isNaN(k)&&~w.indexOf(Number)){S=+k;p++}else if(!k.match(/^-[^-]/)&&~w.indexOf(String)){S=k;p++}}if(E)(t[h]=t[h]||[]).push(S);else t[h]=S;continue}if(w===String){if(k===undefined){k=""}else if(k.match(/^-{1,2}[^-]+/)){k="";p--}}if(k&&k.match(/^-{2,}$/)){k=undefined;p--}S=k===undefined?true:k;if(E)(t[h]=t[h]||[]).push(S);else t[h]=S;p++;continue}r.push(h)}}function resolveShort(e,t,r,o){e=e.replace(/^-+/,"");if(o[e]===e)return null;if(t[e]){if(t[e]&&!Array.isArray(t[e]))t[e]=t[e].split(/\s+/);return t[e]}var s=t.___singles;if(!s){s=Object.keys(t).filter((function(e){return e.length===1})).reduce((function(e,t){e[t]=true;return e}),{});t.___singles=s;a("shorthand singles",s)}var u=e.split("").filter((function(e){return s[e]}));if(u.join("")===e)return u.map((function(e){return t[e]})).reduce((function(e,t){return e.concat(t)}),[]);if(o[e]&&!t[e])return null;if(r[e])e=r[e];if(t[e]&&!Array.isArray(t[e]))t[e]=t[e].split(/\s+/);return t[e]}},6286:(e,t,r)=>{const a=r(9491);const o=r(1017);const s=r(7147);let u=undefined;try{u=r(3535)}catch(e){}const c={nosort:true,silent:true};let d=0;const f=process.platform==="win32";const defaults=e=>{const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||s[t];t=t+"Sync";e[t]=e[t]||s[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&u===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||c};const rimraf=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof r,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);let o=0;let s=null;let c=0;const next=e=>{s=s||e;if(--c===0)r(s)};const afterGlob=(e,a)=>{if(e)return r(e);c=a.length;if(c===0)return r();a.forEach((e=>{const CB=r=>{if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&orimraf_(e,t,CB)),o*100)}if(r.code==="EMFILE"&&drimraf_(e,t,CB)),d++)}if(r.code==="ENOENT")r=null}d=0;next(r)};rimraf_(e,t,CB)}))};if(t.disableGlob||!u.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,((r,a)=>{if(!r)return afterGlob(null,[e]);u(e,t.glob,afterGlob)}))};const rimraf_=(e,t,r)=>{a(e);a(t);a(typeof r==="function");t.lstat(e,((a,o)=>{if(a&&a.code==="ENOENT")return r(null);if(a&&a.code==="EPERM"&&f)fixWinEPERM(e,t,a,r);if(o&&o.isDirectory())return rmdir(e,t,a,r);t.unlink(e,(a=>{if(a){if(a.code==="ENOENT")return r(null);if(a.code==="EPERM")return f?fixWinEPERM(e,t,a,r):rmdir(e,t,a,r);if(a.code==="EISDIR")return rmdir(e,t,a,r)}return r(a)}))}))};const fixWinEPERM=(e,t,r,o)=>{a(e);a(t);a(typeof o==="function");t.chmod(e,438,(a=>{if(a)o(a.code==="ENOENT"?null:r);else t.stat(e,((a,s)=>{if(a)o(a.code==="ENOENT"?null:r);else if(s.isDirectory())rmdir(e,t,r,o);else t.unlink(e,o)}))}))};const fixWinEPERMSync=(e,t,r)=>{a(e);a(t);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT")return;else throw r}let o;try{o=t.statSync(e)}catch(e){if(e.code==="ENOENT")return;else throw r}if(o.isDirectory())rmdirSync(e,t,r);else t.unlinkSync(e)};const rmdir=(e,t,r,o)=>{a(e);a(t);a(typeof o==="function");t.rmdir(e,(a=>{if(a&&(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM"))rmkids(e,t,o);else if(a&&a.code==="ENOTDIR")o(r);else o(a)}))};const rmkids=(e,t,r)=>{a(e);a(t);a(typeof r==="function");t.readdir(e,((a,s)=>{if(a)return r(a);let u=s.length;if(u===0)return t.rmdir(e,r);let c;s.forEach((a=>{rimraf(o.join(e,a),t,(a=>{if(c)return;if(a)return r(c=a);if(--u===0)t.rmdir(e,r)}))}))}))};const rimrafSync=(e,t)=>{t=t||{};defaults(t);a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a(t,"rimraf: missing options");a.equal(typeof t,"object","rimraf: options should be object");let r;if(t.disableGlob||!u.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(a){r=u.sync(e,t.glob)}}if(!r.length)return;for(let e=0;e{a(e);a(t);try{t.rmdirSync(e)}catch(a){if(a.code==="ENOENT")return;if(a.code==="ENOTDIR")throw r;if(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM")rmkidsSync(e,t)}};const rmkidsSync=(e,t)=>{a(e);a(t);t.readdirSync(e).forEach((r=>rimrafSync(o.join(e,r),t)));const r=f?100:1;let s=0;do{let a=true;try{const o=t.rmdirSync(e,t);a=false;return o}finally{if(++sq,env:{NODE_ENV:u.UNKNOWN,[u.UNKNOWN]:true},[u.UNKNOWN]:true};const T=Symbol();const C=Symbol();const j=Symbol();const N=Symbol();const L=Symbol();const I=Symbol();const P=Symbol();const D=Symbol();const M={access:I,accessSync:I,createReadStream:I,exists:I,existsSync:I,fstat:I,fstatSync:I,lstat:I,lstatSync:I,open:I,readFile:I,readFileSync:I,stat:I,statSync:I};const W=Object.assign(Object.create(null),{bindings:{default:P},express:{default:function(){return{[u.UNKNOWN]:true,set:T,engine:C}}},fs:Object.assign({default:M},M),process:Object.assign({default:O},O),path:{default:{}},os:Object.assign({default:k.default},k.default),"@mapbox/node-pre-gyp":Object.assign({default:w.default},w.default),"node-pre-gyp":v.pregyp,"node-pre-gyp/lib/pre-binding":v.pregyp,"node-pre-gyp/lib/pre-binding.js":v.pregyp,"node-gyp-build":{default:D},nbind:{init:j,default:{init:j}},"resolve-from":{default:A.default},"strong-globalize":{default:{SetRootDir:N},SetRootDir:N},pkginfo:{default:L}});const F={_interopRequireDefault:_.normalizeDefaultRequire,_interopRequireWildcard:_.normalizeWildcardRequire,__importDefault:_.normalizeDefaultRequire,__importStar:_.normalizeWildcardRequire,MONGOOSE_DRIVER_PATH:undefined,URL:x.URL,Object:{assign:Object.assign}};F.global=F.GLOBAL=F.globalThis=F;const B=Symbol();v.pregyp.find[B]=true;const $=W.path;Object.keys(o.default).forEach((e=>{const t=o.default[e];if(typeof t==="function"){const r=function mockPath(){return t.apply(mockPath,arguments)};r[B]=true;$[e]=$.default[e]=r}else{$[e]=$.default[e]=t}}));$.resolve=$.default.resolve=function(...e){return o.default.resolve.apply(this,[q,...e])};$.resolve[B]=true;const U=new Set([".h",".cmake",".c",".cpp"]);const H=new Set(["CHANGELOG.md","README.md","readme.md","changelog.md"]);let q;const G=/^\/[^\/]+|^[a-z]:[\\/][^\\/]+/i;function isAbsolutePathOrUrl(e){if(e instanceof x.URL)return e.protocol==="file:";if(typeof e==="string"){if(e.startsWith("file:")){try{new x.URL(e);return true}catch(e){return false}}return G.test(e)}return false}const K=Symbol();const z=/([\/\\]\*\*[\/\\]\*)+/g;async function analyze(e,t,r){const a=new Set;const c=new Set;const _=new Set;const w=o.default.dirname(e);q=r.cwd;const k=h.getPackageBase(e);const emitAssetDirectory=e=>{if(!r.analysis.emitGlobs)return;const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);const d=e.substr(s);const f=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.sep?"**/*":"*")).replace(z,"/**/*")||"/**/*";if(r.ignoreFn(o.default.relative(r.base,c+f)))return;A=A.then((async()=>{if(r.log)console.log("Globbing "+c+f);const e=await new Promise(((e,t)=>p.default(c+f,{mark:true,ignore:c+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));e.filter((e=>!U.has(o.default.extname(e))&&!H.has(o.default.basename(e))&&!e.endsWith("/"))).forEach((e=>a.add(e)))}))};let A=Promise.resolve();t=t.replace(/^#![^\n\r]*[\r\n]/,"");let M;let $=false;try{M=S.parse(t,{ecmaVersion:"latest",allowReturnOutsideFunction:true});$=false}catch(t){const a=t&&t.message&&t.message.includes("sourceType: module");if(!a){r.warnings.add(new Error(`Failed to parse ${e} as script:\n${t&&t.message}`))}}if(!M){try{M=S.parse(t,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:true});$=true}catch(t){r.warnings.add(new Error(`Failed to parse ${e} as module:\n${t&&t.message}`));return{assets:a,deps:c,imports:_,isESM:false}}}const V=x.pathToFileURL(e).href;const Y=Object.assign(Object.create(null),{__dirname:{shadowDepth:0,value:{value:o.default.resolve(e,"..")}},__filename:{shadowDepth:0,value:{value:e}},process:{shadowDepth:0,value:{value:O}}});if(!$||r.mixedModules){Y.require={shadowDepth:0,value:{value:{[u.FUNCTION](e){c.add(e);const t=W[e];return t.default},resolve(t){return y.default(t,e,r)}}}};Y.require.value.value.resolve[B]=true}function setKnownBinding(e,t){if(e==="require")return;Y[e]={shadowDepth:0,value:t}}function getKnownBinding(e){const t=Y[e];if(t){if(t.shadowDepth===0){return t.value}}return undefined}function hasKnownBindingValue(e){const t=Y[e];return t&&t.shadowDepth===0}if(($||r.mixedModules)&&isAst(M)){for(const e of M.body){if(e.type==="ImportDeclaration"){const t=String(e.source.value);c.add(t);const r=W[t];if(r){for(const t of e.specifiers){if(t.type==="ImportNamespaceSpecifier")setKnownBinding(t.local.name,{value:r});else if(t.type==="ImportDefaultSpecifier"&&"default"in r)setKnownBinding(t.local.name,{value:r.default});else if(t.type==="ImportSpecifier"&&t.imported.name in r)setKnownBinding(t.local.name,{value:r[t.imported.name]})}}}else if(e.type==="ExportNamedDeclaration"||e.type==="ExportAllDeclaration"){if(e.source)c.add(String(e.source.value))}}}async function computePureStaticValue(e,t=true){const r=Object.create(null);Object.keys(F).forEach((e=>{r[e]={value:F[e]}}));Object.keys(Y).forEach((e=>{r[e]=getKnownBinding(e)}));r["import.meta"]={url:V};const a=await u.evaluate(e,r,t);return a}let Q;let X;let Z=false;function emitWildcardRequire(e){if(!r.analysis.emitGlobs||!e.startsWith("./")&&!e.startsWith("../"))return;e=o.default.resolve(w,e);const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);const d=e.substr(s);let f=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.sep?"**/*":"*"))||"/**/*";if(!f.endsWith("*"))f+="?("+(r.ts?".ts|.tsx|":"")+".js|.json|.node)";if(r.ignoreFn(o.default.relative(r.base,c+f)))return;A=A.then((async()=>{if(r.log)console.log("Globbing "+c+f);const e=await new Promise(((e,t)=>p.default(c+f,{mark:true,ignore:c+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));e.filter((e=>!U.has(o.default.extname(e))&&!H.has(o.default.basename(e))&&!e.endsWith("/"))).forEach((e=>a.add(e)))}))}async function processRequireArg(e,t=false){if(e.type==="ConditionalExpression"){await processRequireArg(e.consequent,t);await processRequireArg(e.alternate,t);return}if(e.type==="LogicalExpression"){await processRequireArg(e.left,t);await processRequireArg(e.right,t);return}let r=await computePureStaticValue(e,true);if(!r)return;if("value"in r&&typeof r.value==="string"){if(!r.wildcards)(t?_:c).add(r.value);else if(r.wildcards.length>=1)emitWildcardRequire(r.value)}else{if("then"in r&&typeof r.then==="string")(t?_:c).add(r.then);if("else"in r&&typeof r.else==="string")(t?_:c).add(r.else)}}let J=s.attachScopes(M,"scope");if(isAst(M)){R.handleWrappers(M);await g.default({id:e,ast:M,emitAsset:e=>a.add(e),emitAssetDirectory:emitAssetDirectory,job:r})}async function backtrack(e,t){if(!Q)throw new Error("Internal error: No staticChildNode for backtrack.");const r=await computePureStaticValue(e,true);if(r){if("value"in r&&typeof r.value!=="symbol"||"then"in r&&typeof r.then!=="symbol"&&typeof r.else!=="symbol"){X=r;Q=e;if(t)t.skip();return}}await emitStaticChildAsset()}await E(M,{async enter(t,s){var u;const p=t;const h=s;if(p.scope){J=p.scope;for(const e in p.scope.declarations){if(e in Y)Y[e].shadowDepth++}}if(Q)return;if(!h)return;if(p.type==="Identifier"){if(f.isIdentifierRead(p,h)&&r.analysis.computeFileReferences){let e;if(typeof(e=(u=getKnownBinding(p.name))===null||u===void 0?void 0:u.value)==="string"&&e.match(G)||e&&(typeof e==="function"||typeof e==="object")&&e[B]){X={value:typeof e==="string"?e:undefined};Q=p;await backtrack(h,this)}}}else if(r.analysis.computeFileReferences&&p.type==="MemberExpression"&&p.object.type==="MetaProperty"&&p.object.meta.name==="import"&&p.object.property.name==="meta"&&(p.property.computed?p.property.value:p.property.name)==="url"){X={value:V};Q=p;await backtrack(h,this)}else if(p.type==="ImportExpression"){await processRequireArg(p.source,true);return}else if(p.type==="CallExpression"){if((!$||r.mixedModules)&&p.callee.type==="Identifier"&&p.arguments.length){if(p.callee.name==="require"&&Y.require.shadowDepth===0){await processRequireArg(p.arguments[0]);return}}else if((!$||r.mixedModules)&&p.callee.type==="MemberExpression"&&p.callee.object.type==="Identifier"&&p.callee.object.name==="module"&&"module"in Y===false&&p.callee.property.type==="Identifier"&&!p.callee.computed&&p.callee.property.name==="require"&&p.arguments.length){await processRequireArg(p.arguments[0]);return}const t=r.analysis.evaluatePureExpressions&&await computePureStaticValue(p.callee,false);if(t&&"value"in t&&typeof t.value==="function"&&t.value[B]&&r.analysis.computeFileReferences){X=await computePureStaticValue(p,true);if(X&&h){Q=p;await backtrack(h,this)}}else if(t&&"value"in t&&typeof t.value==="symbol"){switch(t.value){case K:if(p.arguments.length===1&&p.arguments[0].type==="Literal"&&p.callee.type==="Identifier"&&Y.require.shadowDepth===0){await processRequireArg(p.arguments[0])}break;case P:if(p.arguments.length){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&e.value){let t;if(typeof e.value==="object")t=e.value;else if(typeof e.value==="string")t={bindings:e.value};if(!t.path){t.path=true}t.module_root=k;let r;try{r=d.default(t)}catch(e){}if(r){X={value:r};Q=p;await emitStaticChildAsset()}}}break;case D:if(p.arguments.length===1&&p.arguments[0].type==="Identifier"&&p.arguments[0].name==="__dirname"&&Y.__dirname.shadowDepth===0){let e;try{e=m.default.path(w)}catch(e){}if(e){X={value:e};Q=p;await emitStaticChildAsset()}}break;case j:if(p.arguments.length){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&(typeof e.value==="string"||typeof e.value==="undefined")){const t=v.nbind(e.value);if(t&&t.path){c.add(o.default.relative(w,t.path).replace(/\\/g,"/"));return this.skip()}}}break;case T:if(p.arguments.length===2&&p.arguments[0].type==="Literal"&&p.arguments[0].value==="view engine"&&!Z){await processRequireArg(p.arguments[1]);return this.skip()}break;case C:Z=true;break;case I:if(p.arguments[0]&&r.analysis.computeFileReferences){X=await computePureStaticValue(p.arguments[0],true);if(X){Q=p.arguments[0];await backtrack(h,this);return this.skip()}}break;case N:if(p.arguments[0]){const e=await computePureStaticValue(p.arguments[0],false);if(e&&"value"in e&&e.value)emitAssetDirectory(e.value+"/intl");return this.skip()}break;case L:let t=o.default.resolve(e,"../package.json");const s=o.default.resolve("/package.json");while(t!==s&&await r.stat(t)===null)t=o.default.resolve(t,"../../package.json");if(t!==s)a.add(t);break}}}else if(p.type==="VariableDeclaration"&&h&&!f.isVarLoop(h)&&r.analysis.evaluatePureExpressions){for(const e of p.declarations){if(!e.init)continue;const t=await computePureStaticValue(e.init,true);if(t){if(e.id.type==="Identifier"){setKnownBinding(e.id.name,t)}else if(e.id.type==="ObjectPattern"&&"value"in t){for(const r of e.id.properties){if(r.type!=="Property"||r.key.type!=="Identifier"||r.value.type!=="Identifier"||typeof t.value!=="object"||t.value===null||!(r.key.name in t.value))continue;setKnownBinding(r.value.name,{value:t.value[r.key.name]})}}if(!("value"in t)&&isAbsolutePathOrUrl(t.then)&&isAbsolutePathOrUrl(t.else)){X=t;Q=e.init;await emitStaticChildAsset()}}}}else if(p.type==="AssignmentExpression"&&h&&!f.isLoop(h)&&r.analysis.evaluatePureExpressions){if(!hasKnownBindingValue(p.left.name)){const e=await computePureStaticValue(p.right,false);if(e&&"value"in e){if(p.left.type==="Identifier"){setKnownBinding(p.left.name,e)}else if(p.left.type==="ObjectPattern"){for(const t of p.left.properties){if(t.type!=="Property"||t.key.type!=="Identifier"||t.value.type!=="Identifier"||typeof e.value!=="object"||e.value===null||!(t.key.name in e.value))continue;setKnownBinding(t.value.name,{value:e.value[t.key.name]})}}if(isAbsolutePathOrUrl(e.value)){X=e;Q=p.right;await emitStaticChildAsset()}}}}else if((!$||r.mixedModules)&&(p.type==="FunctionDeclaration"||p.type==="FunctionExpression"||p.type==="ArrowFunctionExpression")&&(p.arguments||p.params)[0]&&(p.arguments||p.params)[0].type==="Identifier"){let e;let t;if((p.type==="ArrowFunctionExpression"||p.type==="FunctionExpression")&&h&&h.type==="VariableDeclarator"&&h.id.type==="Identifier"){e=h.id;t=p.arguments||p.params}else if(p.id){e=p.id;t=p.arguments||p.params}if(e&&p.body.body){let r,a=false;for(let e=0;ee&&e.id&&e.id.type==="Identifier"&&e.init&&e.init.type==="CallExpression"&&e.init.callee.type==="Identifier"&&e.init.callee.name==="require"&&Y.require.shadowDepth===0&&e.init.arguments[0]&&e.init.arguments[0].type==="Identifier"&&e.init.arguments[0].name===t[0].name))}if(r&&p.body.body[e].type==="ReturnStatement"&&p.body.body[e].argument&&p.body.body[e].argument.type==="Identifier"&&p.body.body[e].argument.name===r.id.name){a=true;break}}if(a)setKnownBinding(e.name,{value:K})}}},async leave(e,t){const r=e;const a=t;if(r.scope){if(J.parent){J=J.parent}for(const e in r.scope.declarations){if(e in Y){if(Y[e].shadowDepth>0)Y[e].shadowDepth--;else delete Y[e]}}}if(Q&&a)await backtrack(a,this)}});await A;return{assets:a,deps:c,imports:_,isESM:$};async function emitAssetPath(e){const t=e.indexOf(u.WILDCARD);const s=t===-1?e.length:e.lastIndexOf(o.default.sep,t);const c=e.substr(0,s);try{var d=await r.stat(c);if(d===null){throw new Error("file not found")}}catch(e){return}if(t!==-1&&d.isFile())return;if(d.isFile()){a.add(e)}else if(d.isDirectory()){if(validWildcard(e))emitAssetDirectory(e)}}function validWildcard(t){let a="";if(t.endsWith(o.default.sep))a=o.default.sep;else if(t.endsWith(o.default.sep+u.WILDCARD))a=o.default.sep+u.WILDCARD;else if(t.endsWith(u.WILDCARD))a=u.WILDCARD;if(t===w+a)return false;if(t===q+a)return false;if(t.endsWith(o.default.sep+"node_modules"+a))return false;if(w.startsWith(t.substr(0,t.length-a.length)+o.default.sep))return false;if(k){const a=e.substr(0,e.indexOf(o.default.sep+"node_modules"))+o.default.sep+"node_modules"+o.default.sep;if(!t.startsWith(a)){if(r.log)console.log("Skipping asset emission of "+t.replace(u.wildcardRegEx,"*")+" for "+e+" as it is outside the package base "+k);return false}}return true}function resolveAbsolutePathOrUrl(e){return e instanceof x.URL?x.fileURLToPath(e):e.startsWith("file:")?x.fileURLToPath(new x.URL(e)):o.default.resolve(e)}async function emitStaticChildAsset(){if(!X){return}if("value"in X&&isAbsolutePathOrUrl(X.value)){try{const e=resolveAbsolutePathOrUrl(X.value);await emitAssetPath(e)}catch(e){}}else if("then"in X&&"else"in X&&isAbsolutePathOrUrl(X.then)&&isAbsolutePathOrUrl(X.else)){let e;try{e=resolveAbsolutePathOrUrl(X.then)}catch(e){}let t;try{t=resolveAbsolutePathOrUrl(X.else)}catch(e){}if(e)await emitAssetPath(e);if(t)await emitAssetPath(t)}else if(Q&&Q.type==="ArrayExpression"&&"value"in X&&X.value instanceof Array){for(const e of X.value){try{const t=resolveAbsolutePathOrUrl(e);await emitAssetPath(t)}catch(e){}}}Q=X=undefined}}t["default"]=analyze;function isAst(e){return"body"in e}},9582:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;Object.defineProperty(e,a,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!t.hasOwnProperty(r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});o(r(3864),t);var s=r(3471);Object.defineProperty(t,"nodeFileTrace",{enumerable:true,get:function(){return s.nodeFileTrace}})},3471:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Job=t.nodeFileTrace=void 0;const o=r(1017);const s=a(r(552));const u=a(r(8827));const c=a(r(2278));const d=r(2540);const f=r(2985);const p=r(1017);const h=s.default.promises.readFile;const v=s.default.promises.readlink;const _=s.default.promises.stat;function inPath(e,t){const r=p.join(t,o.sep);return e.startsWith(r)&&e!==r}async function nodeFileTrace(e,t={}){const r=new Job(t);if(t.readFile)r.readFile=t.readFile;if(t.stat)r.stat=t.stat;if(t.readlink)r.readlink=t.readlink;if(t.resolve)r.resolve=t.resolve;r.ts=true;await Promise.all(e.map((async e=>{const t=o.resolve(e);await r.emitFile(t,"initial");if(t.endsWith(".js")||t.endsWith(".cjs")||t.endsWith(".mjs")||t.endsWith(".node")||r.ts&&(t.endsWith(".ts")||t.endsWith(".tsx"))){return r.emitDependency(t)}return undefined})));const a={fileList:r.fileList,esmFileList:r.esmFileList,reasons:r.reasons,warnings:r.warnings};return a}t.nodeFileTrace=nodeFileTrace;class Job{constructor({base:e=process.cwd(),processCwd:t,exports:r,conditions:a=r||["node"],exportsOnly:s=false,paths:u={},ignore:c,log:f=false,mixedModules:p=false,ts:h=true,analysis:v={},cache:_}){this.reasons=new Map;this.ts=h;e=o.resolve(e);this.ignoreFn=e=>{if(e.startsWith(".."+o.sep))return true;return false};if(typeof c==="string")c=[c];if(typeof c==="function"){const e=c;this.ignoreFn=t=>{if(t.startsWith(".."+o.sep))return true;if(e(t))return true;return false}}else if(Array.isArray(c)){const t=c.map((t=>o.relative(e,o.resolve(e||process.cwd(),t))));this.ignoreFn=e=>{if(e.startsWith(".."+o.sep))return true;if(d.isMatch(e,t))return true;return false}}this.base=e;this.cwd=o.resolve(t||e);this.conditions=a;this.exportsOnly=s;const g={};for(const t of Object.keys(u)){const r=u[t].endsWith("/");const a=o.resolve(e,u[t]);g[t]=a+(r?"/":"")}this.paths=g;this.log=f;this.mixedModules=p;this.analysis={};if(v!==false){Object.assign(this.analysis,{emitGlobs:true,computeFileReferences:true,evaluatePureExpressions:true},v===true?{}:v)}this.fileCache=_&&_.fileCache||new Map;this.statCache=_&&_.statCache||new Map;this.symlinkCache=_&&_.symlinkCache||new Map;this.analysisCache=_&&_.analysisCache||new Map;if(_){_.fileCache=this.fileCache;_.statCache=this.statCache;_.symlinkCache=this.symlinkCache;_.analysisCache=this.analysisCache}this.fileList=new Set;this.esmFileList=new Set;this.processed=new Set;this.warnings=new Set}async readlink(e){const t=this.symlinkCache.get(e);if(t!==undefined)return t;try{const t=await v(e);const r=this.statCache.get(e);if(r)this.statCache.set(o.resolve(e,t),r);this.symlinkCache.set(e,t);return t}catch(t){if(t.code!=="EINVAL"&&t.code!=="ENOENT"&&t.code!=="UNKNOWN")throw t;this.symlinkCache.set(e,null);return null}}async isFile(e){const t=await this.stat(e);if(t)return t.isFile();return false}async isDir(e){const t=await this.stat(e);if(t)return t.isDirectory();return false}async stat(e){const t=this.statCache.get(e);if(t)return t;try{const t=await _(e);this.statCache.set(e,t);return t}catch(t){if(t.code==="ENOENT"){this.statCache.set(e,null);return null}throw t}}async resolve(e,t,r,a){return c.default(e,t,r,a)}async readFile(e){const t=this.fileCache.get(e);if(t!==undefined)return t;try{const t=(await h(e)).toString();this.fileCache.set(e,t);return t}catch(t){if(t.code==="ENOENT"||t.code==="EISDIR"){this.fileCache.set(e,null);return null}throw t}}async realpath(e,t,r=new Set){if(r.has(e))throw new Error("Recursive symlink detected resolving "+e);r.add(e);const a=await this.readlink(e);if(a){const s=o.dirname(e);const u=o.resolve(s,a);const c=await this.realpath(s,t);if(inPath(e,c))await this.emitFile(e,"resolve",t,true);return this.realpath(u,t,r)}if(!inPath(e,this.base))return e;return p.join(await this.realpath(o.dirname(e),t,r),o.basename(e))}async emitFile(e,t,r,a=false){if(!a){e=await this.realpath(e,r)}e=o.relative(this.base,e);if(r){r=o.relative(this.base,r)}let s=this.reasons.get(e);if(!s){s={type:t,ignored:false,parents:new Set};this.reasons.set(e,s)}if(r&&this.ignoreFn(e,r)){if(!this.fileList.has(e)&&s){s.ignored=true}return false}if(r){s.parents.add(r)}this.fileList.add(e);return true}async getPjsonBoundary(e){const t=e.indexOf(o.sep);let r;while((r=e.lastIndexOf(o.sep))>t){e=e.substr(0,r);if(await this.isFile(e+o.sep+"package.json"))return e}return undefined}async emitDependency(e,t){if(this.processed.has(e)){if(t){await this.emitFile(e,"dependency",t)}return}this.processed.add(e);const r=await this.emitFile(e,"dependency",t);if(!r)return;if(e.endsWith(".json"))return;if(e.endsWith(".node"))return await f.sharedLibEmit(e,this);if(e.endsWith(".js")){const t=await this.getPjsonBoundary(e);if(t)await this.emitFile(t+o.sep+"package.json","resolve",e)}let a;const s=this.analysisCache.get(e);if(s){a=s}else{const t=await this.readFile(e);if(t===null)throw new Error("File "+e+" does not exist.");a=await u.default(e,t.toString(),this);this.analysisCache.set(e,a)}const{deps:c,imports:d,assets:p,isESM:h}=a;if(h)this.esmFileList.add(o.relative(this.base,e));await Promise.all([...[...p].map((async t=>{const r=o.extname(t);if(r===".js"||r===".mjs"||r===".node"||r===""||this.ts&&(r===".ts"||r===".tsx")&&t.startsWith(this.base)&&t.substr(this.base.length).indexOf(o.sep+"node_modules"+o.sep)===-1)await this.emitDependency(t,e);else await this.emitFile(t,"asset",e)})),...[...c].map((async t=>{try{var r=await this.resolve(t,e,this,!h)}catch(e){this.warnings.add(new Error(`Failed to resolve dependency ${t}:\n${e&&e.message}`));return}if(Array.isArray(r)){for(const t of r){if(t.startsWith("node:"))return;await this.emitDependency(t,e)}}else{if(r.startsWith("node:"))return;await this.emitDependency(r,e)}})),...[...d].map((async t=>{try{var r=await this.resolve(t,e,this,false)}catch(e){this.warnings.add(new Error(`Failed to resolve dependency ${t}:\n${e&&e.message}`));return}if(Array.isArray(r)){for(const t of r){if(t.startsWith("node:"))return;await this.emitDependency(t,e)}}else{if(r.startsWith("node:"))return;await this.emitDependency(r,e)}}))])}}t.Job=Job},2278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const a=r(1017);async function resolveDependency(e,t,r,o=true){let s;if(a.isAbsolute(e)||e==="."||e===".."||e.startsWith("./")||e.startsWith("../")){const o=e.endsWith("/");s=await resolvePath(a.resolve(t,"..",e)+(o?"/":""),t,r)}else if(e[0]==="#"){s=await packageImportsResolve(e,t,r,o)}else{s=await resolvePackage(e,t,r,o)}if(Array.isArray(s)){return Promise.all(s.map((e=>r.realpath(e,t))))}else if(s.startsWith("node:")){return s}else{return r.realpath(s,t)}}t["default"]=resolveDependency;async function resolvePath(e,t,r){const a=await resolveFile(e,t,r)||await resolveDir(e,t,r);if(!a){throw new NotFoundError(e,t)}return a}async function resolveFile(e,t,r){if(e.endsWith("/"))return undefined;e=await r.realpath(e,t);if(await r.isFile(e))return e;if(r.ts&&e.startsWith(r.base)&&e.substr(r.base.length).indexOf(a.sep+"node_modules"+a.sep)===-1&&await r.isFile(e+".ts"))return e+".ts";if(r.ts&&e.startsWith(r.base)&&e.substr(r.base.length).indexOf(a.sep+"node_modules"+a.sep)===-1&&await r.isFile(e+".tsx"))return e+".tsx";if(await r.isFile(e+".js"))return e+".js";if(await r.isFile(e+".json"))return e+".json";if(await r.isFile(e+".node"))return e+".node";return undefined}async function resolveDir(e,t,r){if(e.endsWith("/"))e=e.slice(0,-1);if(!await r.isDir(e))return;const o=await getPkgCfg(e,r);if(o&&typeof o.main==="string"){const s=await resolveFile(a.resolve(e,o.main),t,r)||await resolveFile(a.resolve(e,o.main,"index"),t,r);if(s){await r.emitFile(e+a.sep+"package.json","resolve",t);return s}}return resolveFile(a.resolve(e,"index"),t,r)}class NotFoundError extends Error{constructor(e,t){super("Cannot find module '"+e+"' loaded from "+t);this.code="MODULE_NOT_FOUND"}}const o=new Set([...r(8102)._builtinLibs,"constants","module","timers","console","_stream_writable","_stream_readable","_stream_duplex","process","sys"]);function getPkgName(e){const t=e.split("/");if(e[0]==="@"&&t.length>1)return t.length>1?t.slice(0,2).join("/"):null;return t.length?t[0]:null}async function getPkgCfg(e,t){const r=await t.readFile(e+a.sep+"package.json");if(r){try{return JSON.parse(r.toString())}catch(e){}}return undefined}function getExportsTarget(e,t,r){if(typeof e==="string"){return e}else if(e===null){return e}else if(Array.isArray(e)){for(const a of e){const e=getExportsTarget(a,t,r);if(e===null||typeof e==="string"&&e.startsWith("./"))return e}}else if(typeof e==="object"){for(const a of Object.keys(e)){if(a==="default"||a==="require"&&r||a==="import"&&!r||t.includes(a)){const o=getExportsTarget(e[a],t,r);if(o!==undefined)return o}}}return undefined}function resolveExportsImports(e,t,r,a,o,s){let u;if(o){if(!(typeof t==="object"&&!Array.isArray(t)&&t!==null))return undefined;u=t}else if(typeof t==="string"||Array.isArray(t)||t===null||typeof t==="object"&&Object.keys(t).length&&Object.keys(t)[0][0]!=="."){u={".":t}}else{u=t}if(r in u){const t=getExportsTarget(u[r],a.conditions,s);if(typeof t==="string"&&t.startsWith("./"))return e+t.slice(1)}for(const t of Object.keys(u).sort(((e,t)=>t.length-e.length))){if(t.endsWith("*")&&r.startsWith(t.slice(0,-1))){const o=getExportsTarget(u[t],a.conditions,s);if(typeof o==="string"&&o.startsWith("./"))return e+o.slice(1).replace(/\*/g,r.slice(t.length-1))}if(!t.endsWith("/"))continue;if(r.startsWith(t)){const o=getExportsTarget(u[t],a.conditions,s);if(typeof o==="string"&&o.endsWith("/")&&o.startsWith("./"))return e+o.slice(1)+r.slice(t.length)}}return undefined}async function packageImportsResolve(e,t,r,o){if(e!=="#"&&!e.startsWith("#/")&&r.conditions){const s=await r.getPjsonBoundary(t);if(s){const u=await getPkgCfg(s,r);const{imports:c}=u||{};if(u&&c!==null&&c!==undefined){let u=resolveExportsImports(s,c,e,r,true,o);if(u){if(o)u=await resolveFile(u,t,r)||await resolveDir(u,t,r);else if(!await r.isFile(u))throw new NotFoundError(u,t);if(u){await r.emitFile(s+a.sep+"package.json","resolve",t);return u}}}}}throw new NotFoundError(e,t)}async function resolvePackage(e,t,r,s){let u=t;if(o.has(e))return"node:"+e;const c=getPkgName(e)||"";let d;if(r.conditions){const o=await r.getPjsonBoundary(t);if(o){const u=await getPkgCfg(o,r);const{exports:f}=u||{};if(u&&u.name&&u.name===c&&f!==null&&f!==undefined){d=resolveExportsImports(o,f,"."+e.slice(c.length),r,false,s);if(d){if(s)d=await resolveFile(d,t,r)||await resolveDir(d,t,r);else if(!await r.isFile(d))throw new NotFoundError(d,t)}if(d)await r.emitFile(o+a.sep+"package.json","resolve",t)}}}let f;const p=u.indexOf(a.sep);while((f=u.lastIndexOf(a.sep))>p){u=u.substr(0,f);const o=u+a.sep+"node_modules";const p=await r.stat(o);if(!p||!p.isDirectory())continue;const h=await getPkgCfg(o+a.sep+c,r);const{exports:v}=h||{};if(r.conditions&&v!==undefined&&v!==null&&!d){let u;if(!r.exportsOnly)u=await resolveFile(o+a.sep+e,t,r)||await resolveDir(o+a.sep+e,t,r);let d=resolveExportsImports(o+a.sep+c,v,"."+e.slice(c.length),r,false,s);if(d){if(s)d=await resolveFile(d,t,r)||await resolveDir(d,t,r);else if(!await r.isFile(d))throw new NotFoundError(d,t)}if(d){await r.emitFile(o+a.sep+c+a.sep+"package.json","resolve",t);if(u&&u!==d)return[d,u];return d}if(u)return u}else{const s=await resolveFile(o+a.sep+e,t,r)||await resolveDir(o+a.sep+e,t,r);if(s){if(d&&d!==s)return[s,d];return s}}}if(d)return d;if(Object.hasOwnProperty.call(r.paths,e)){return r.paths[e]}for(const a of Object.keys(r.paths)){if(a.endsWith("/")&&e.startsWith(a)){const o=r.paths[a]+e.slice(a.length);const s=await resolveFile(o,t,r)||await resolveDir(o,t,r);if(!s){throw new NotFoundError(e,t)}return s}}throw new NotFoundError(e,t)}},3864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5078:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isLoop=t.isVarLoop=t.isIdentifierRead=void 0;function isIdentifierRead(e,t){switch(t.type){case"ObjectPattern":case"ArrayPattern":return false;case"AssignmentExpression":return t.right===e;case"MemberExpression":return t.computed||e===t.object;case"Property":return e===t.value;case"MethodDefinition":return false;case"VariableDeclarator":return t.id!==e;case"ExportSpecifier":return false;case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":return false;default:return true}}t.isIdentifierRead=isIdentifierRead;function isVarLoop(e){return e.type==="ForStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"}t.isVarLoop=isVarLoop;function isLoop(e){return e.type==="ForStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"||e.type==="WhileStatement"||e.type==="DoWhileStatement"}t.isLoop=isLoop},2774:function(__unused_webpack_module,exports,__nccwpck_require__){"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:true});exports.nbind=exports.pregyp=void 0;const path_1=__importDefault(__nccwpck_require__(1017));const graceful_fs_1=__importDefault(__nccwpck_require__(552));const versioning=__nccwpck_require__(5574);const napi=__nccwpck_require__(9248);const pregypFind=(e,t)=>{const r=JSON.parse(graceful_fs_1.default.readFileSync(e).toString());versioning.validate_config(r,t);var a;if(napi.get_napi_build_versions(r,t)){a=napi.get_best_napi_build_version(r,t)}t=t||{};if(!t.module_root)t.module_root=path_1.default.dirname(e);var o=versioning.evaluate(r,t,a);return o.module};exports.pregyp={default:{find:pregypFind},find:pregypFind};function makeModulePathList(e,t){return[[e,t],[e,"build",t],[e,"build","Debug",t],[e,"build","Release",t],[e,"out","Debug",t],[e,"Debug",t],[e,"out","Release",t],[e,"Release",t],[e,"build","default",t],[e,process.env["NODE_BINDINGS_COMPILED_DIR"]||"compiled",process.versions.node,process.platform,process.arch,t]]}function findCompiledModule(basePath,specList){var resolvedList=[];var ext=path_1.default.extname(basePath);for(var _i=0,specList_1=specList;_i{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPackageName=t.getPackageBase=void 0;const r=/^(@[^\\\/]+[\\\/])?[^\\\/]+/;function getPackageBase(e){const t=e.lastIndexOf("node_modules");if(t!==-1&&(e[t-1]==="/"||e[t-1]==="\\")&&(e[t+12]==="/"||e[t+12]==="\\")){const a=e.substr(t+13).match(r);if(a)return e.substr(0,t+13+a[0].length)}return undefined}t.getPackageBase=getPackageBase;function getPackageName(e){const t=e.lastIndexOf("node_modules");if(t!==-1&&(e[t-1]==="/"||e[t-1]==="\\")&&(e[t+12]==="/"||e[t+12]==="\\")){const a=e.substr(t+13).match(r);if(a&&a.length>0){return a[0].replace(/\\/g,"/")}}return undefined}t.getPackageName=getPackageName},216:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.normalizeWildcardRequire=t.normalizeDefaultRequire=void 0;function normalizeDefaultRequire(e){if(e&&e.__esModule)return e;return{default:e}}t.normalizeDefaultRequire=normalizeDefaultRequire;const r=Object.prototype.hasOwnProperty;function normalizeWildcardRequire(e){if(e&&e.__esModule)return e;const t={};for(const a in e){if(!r.call(e,a))continue;t[a]=e[a]}t["default"]=e;return t}t.normalizeWildcardRequire=normalizeWildcardRequire},2985:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.sharedLibEmit=void 0;const o=a(r(2037));const s=a(r(3535));const u=r(7468);let c="";switch(o.default.platform()){case"darwin":c="/**/*.@(dylib|so?(.*))";break;case"win32":c="/**/*.dll";break;default:c="/**/*.so?(.*)"}async function sharedLibEmit(e,t){const r=u.getPackageBase(e);if(!r)return;const a=await new Promise(((e,t)=>s.default(r+c,{ignore:r+"/**/node_modules/**/*"},((r,a)=>r?t(r):e(a)))));await Promise.all(a.map((r=>t.emitFile(r,"sharedlib",e))))}t.sharedLibEmit=sharedLibEmit},5735:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=r(1017);const s=a(r(2278));const u=r(7468);const c=r(552);const d={"@generated/photon"({id:e,emitAssetDirectory:t}){if(e.endsWith("@generated/photon/index.js")){t(o.resolve(o.dirname(e),"runtime/"))}},argon2({id:e,emitAssetDirectory:t}){if(e.endsWith("argon2/argon2.js")){t(o.resolve(o.dirname(e),"build","Release"));t(o.resolve(o.dirname(e),"prebuilds"));t(o.resolve(o.dirname(e),"lib","binding"))}},bull({id:e,emitAssetDirectory:t}){if(e.endsWith("bull/lib/commands/index.js")){t(o.resolve(o.dirname(e)))}},camaro({id:e,emitAsset:t}){if(e.endsWith("camaro/dist/camaro.js")){t(o.resolve(o.dirname(e),"camaro.wasm"))}},"google-gax"({id:e,ast:t,emitAssetDirectory:r}){if(e.endsWith("google-gax/build/src/grpc.js")){for(const a of t.body){if(a.type==="VariableDeclaration"&&a.declarations[0].id.type==="Identifier"&&a.declarations[0].id.name==="googleProtoFilesDir"){r(o.resolve(o.dirname(e),"../../../google-proto-files"))}}}},oracledb({id:e,ast:t,emitAsset:r}){if(e.endsWith("oracledb/lib/oracledb.js")){for(const a of t.body){if(a.type==="ForStatement"&&"body"in a.body&&a.body.body&&Array.isArray(a.body.body)&&a.body.body[0]&&a.body.body[0].type==="TryStatement"&&a.body.body[0].block.body[0]&&a.body.body[0].block.body[0].type==="ExpressionStatement"&&a.body.body[0].block.body[0].expression.type==="AssignmentExpression"&&a.body.body[0].block.body[0].expression.operator==="="&&a.body.body[0].block.body[0].expression.left.type==="Identifier"&&a.body.body[0].block.body[0].expression.left.name==="oracledbCLib"&&a.body.body[0].block.body[0].expression.right.type==="CallExpression"&&a.body.body[0].block.body[0].expression.right.callee.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.callee.name==="require"&&a.body.body[0].block.body[0].expression.right.arguments.length===1&&a.body.body[0].block.body[0].expression.right.arguments[0].type==="MemberExpression"&&a.body.body[0].block.body[0].expression.right.arguments[0].computed===true&&a.body.body[0].block.body[0].expression.right.arguments[0].object.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.arguments[0].object.name==="binaryLocations"&&a.body.body[0].block.body[0].expression.right.arguments[0].property.type==="Identifier"&&a.body.body[0].block.body[0].expression.right.arguments[0].property.name==="i"){a.body.body[0].block.body[0].expression.right.arguments=[{type:"Literal",value:"_"}];const t=global._unit?"3.0.0":JSON.parse(c.readFileSync(e.slice(0,-15)+"package.json","utf8")).version;const s=Number(t.slice(0,t.indexOf(".")))>=4;const u="oracledb-"+(s?t:"abi"+process.versions.modules)+"-"+process.platform+"-"+process.arch+".node";r(o.resolve(e,"../../build/Release/"+u))}}}},"phantomjs-prebuilt"({id:e,emitAssetDirectory:t}){if(e.endsWith("phantomjs-prebuilt/lib/phantomjs.js")){t(o.resolve(o.dirname(e),"..","bin"))}},"remark-prism"({id:e,emitAssetDirectory:t}){const r="remark-prism/src/highlight.js";if(e.endsWith(r)){try{const a=e.slice(0,-r.length);t(o.resolve(a,"prismjs","components"))}catch(e){}}},semver({id:e,emitAsset:t}){if(e.endsWith("semver/index.js")){t(o.resolve(e.replace("index.js","preload.js")))}},"socket.io":async function({id:e,ast:t,job:r}){if(e.endsWith("socket.io/lib/index.js")){async function replaceResolvePathStatement(t){if(t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.operator==="="&&t.expression.right.type==="CallExpression"&&t.expression.right.callee.type==="Identifier"&&t.expression.right.callee.name==="read"&&t.expression.right.arguments.length>=1&&t.expression.right.arguments[0].type==="CallExpression"&&t.expression.right.arguments[0].callee.type==="Identifier"&&t.expression.right.arguments[0].callee.name==="resolvePath"&&t.expression.right.arguments[0].arguments.length===1&&t.expression.right.arguments[0].arguments[0].type==="Literal"){const a=t.expression.right.arguments[0].arguments[0].value;let u;try{const t=await s.default(String(a),e,r);if(typeof t==="string"){u=t}else{return undefined}}catch(e){return undefined}const c="/"+o.relative(o.dirname(e),u);t.expression.right.arguments[0]={type:"BinaryExpression",start:t.expression.right.arguments[0].start,end:t.expression.right.arguments[0].end,operator:"+",left:{type:"Identifier",name:"__dirname"},right:{type:"Literal",value:c,raw:JSON.stringify(c)}}}return undefined}for(const e of t.body){if(e.type==="ExpressionStatement"&&e.expression.type==="AssignmentExpression"&&e.expression.operator==="="&&e.expression.left.type==="MemberExpression"&&e.expression.left.object.type==="MemberExpression"&&e.expression.left.object.object.type==="Identifier"&&e.expression.left.object.object.name==="Server"&&e.expression.left.object.property.type==="Identifier"&&e.expression.left.object.property.name==="prototype"&&e.expression.left.property.type==="Identifier"&&e.expression.left.property.name==="serveClient"&&e.expression.right.type==="FunctionExpression"){for(const t of e.expression.right.body.body){if(t.type==="IfStatement"&&t.consequent&&"body"in t.consequent&&t.consequent.body){const e=t.consequent.body;let r=false;if(Array.isArray(e)&&e[0]&&e[0].type==="ExpressionStatement"){r=await replaceResolvePathStatement(e[0])}if(Array.isArray(e)&&e[1]&&e[1].type==="TryStatement"&&e[1].block.body&&e[1].block.body[0]){r=await replaceResolvePathStatement(e[1].block.body[0])||r}return}}}}}},typescript({id:e,emitAssetDirectory:t}){if(e.endsWith("typescript/lib/tsc.js")){t(o.resolve(e,"../"))}},"uglify-es"({id:e,emitAsset:t}){if(e.endsWith("uglify-es/tools/node.js")){t(o.resolve(e,"../../lib/utils.js"));t(o.resolve(e,"../../lib/ast.js"));t(o.resolve(e,"../../lib/parse.js"));t(o.resolve(e,"../../lib/transform.js"));t(o.resolve(e,"../../lib/scope.js"));t(o.resolve(e,"../../lib/output.js"));t(o.resolve(e,"../../lib/compress.js"));t(o.resolve(e,"../../lib/sourcemap.js"));t(o.resolve(e,"../../lib/mozilla-ast.js"));t(o.resolve(e,"../../lib/propmangle.js"));t(o.resolve(e,"../../lib/minify.js"));t(o.resolve(e,"../exports.js"))}},"uglify-js"({id:e,emitAsset:t,emitAssetDirectory:r}){if(e.endsWith("uglify-js/tools/node.js")){r(o.resolve(e,"../../lib"));t(o.resolve(e,"../exports.js"))}},"playwright-core"({id:e,emitAsset:t}){if(e.endsWith("playwright-core/index.js")){t(o.resolve(o.dirname(e),"browsers.json"))}},"geo-tz"({id:e,emitAsset:t}){if(e.endsWith("geo-tz/dist/geo-tz.js")){t(o.resolve(o.dirname(e),"../data/geo.dat"))}}};async function handleSpecialCases({id:e,ast:t,emitAsset:r,emitAssetDirectory:a,job:o}){const s=u.getPackageName(e);const c=d[s||""];e=e.replace(/\\/g,"/");if(c)await c({id:e,ast:t,emitAsset:r,emitAssetDirectory:a,job:o})}t["default"]=handleSpecialCases},5401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.wildcardRegEx=t.WILDCARD=t.FUNCTION=t.UNKNOWN=t.evaluate=void 0;const a=r(7310);async function evaluate(e,t={},r=true){const a={computeBranches:r,vars:t};return walk(e);function walk(e){const t=o[e.type];if(t){return t.call(a,e,walk)}return undefined}}t.evaluate=evaluate;t.UNKNOWN=Symbol();t.FUNCTION=Symbol();t.WILDCARD="";t.wildcardRegEx=/\x1a/g;function countWildcards(e){t.wildcardRegEx.lastIndex=0;let r=0;while(t.wildcardRegEx.exec(e))r++;return r}const o={ArrayExpression:async function ArrayExpression(e,t){const r=[];for(let a=0,o=e.elements.length;aa.value}}}return undefined},BinaryExpression:async function BinaryExpression(e,r){const a=e.operator;let o=await r(e.left);if(!o&&a!=="+")return;let s=await r(e.right);if(!o&&!s)return;if(!o){if(this.computeBranches&&s&&"value"in s&&typeof s.value==="string")return{value:t.WILDCARD+s.value,wildcards:[e.left,...s.wildcards||[]]};return}if(!s){if(this.computeBranches&&a==="+"){if(o&&"value"in o&&typeof o.value==="string")return{value:o.value+t.WILDCARD,wildcards:[...o.wildcards||[],e.right]}}if(!("test"in o)&&a==="||"&&o.value)return o;return}if("test"in o&&"value"in s){const e=s.value;if(a==="==")return{test:o.test,then:o.then==e,else:o.else==e};if(a==="===")return{test:o.test,then:o.then===e,else:o.else===e};if(a==="!=")return{test:o.test,then:o.then!=e,else:o.else!=e};if(a==="!==")return{test:o.test,then:o.then!==e,else:o.else!==e};if(a==="+")return{test:o.test,then:o.then+e,else:o.else+e};if(a==="-")return{test:o.test,then:o.then-e,else:o.else-e};if(a==="*")return{test:o.test,then:o.then*e,else:o.else*e};if(a==="/")return{test:o.test,then:o.then/e,else:o.else/e};if(a==="%")return{test:o.test,then:o.then%e,else:o.else%e};if(a==="<")return{test:o.test,then:o.then")return{test:o.test,then:o.then>e,else:o.else>e};if(a===">=")return{test:o.test,then:o.then>=e,else:o.else>=e};if(a==="|")return{test:o.test,then:o.then|e,else:o.else|e};if(a==="&")return{test:o.test,then:o.then&e,else:o.else&e};if(a==="^")return{test:o.test,then:o.then^e,else:o.else^e};if(a==="&&")return{test:o.test,then:o.then&&e,else:o.else&&e};if(a==="||")return{test:o.test,then:o.then||e,else:o.else||e}}else if("test"in s&&"value"in o){const e=o.value;if(a==="==")return{test:s.test,then:e==s.then,else:e==s.else};if(a==="===")return{test:s.test,then:e===s.then,else:e===s.else};if(a==="!=")return{test:s.test,then:e!=s.then,else:e!=s.else};if(a==="!==")return{test:s.test,then:e!==s.then,else:e!==s.else};if(a==="+")return{test:s.test,then:e+s.then,else:e+s.else};if(a==="-")return{test:s.test,then:e-s.then,else:e-s.else};if(a==="*")return{test:s.test,then:e*s.then,else:e*s.else};if(a==="/")return{test:s.test,then:e/s.then,else:e/s.else};if(a==="%")return{test:s.test,then:e%s.then,else:e%s.else};if(a==="<")return{test:s.test,then:e")return{test:s.test,then:e>s.then,else:e>s.else};if(a===">=")return{test:s.test,then:e>=s.then,else:e>=s.else};if(a==="|")return{test:s.test,then:e|s.then,else:e|s.else};if(a==="&")return{test:s.test,then:e&s.then,else:e&s.else};if(a==="^")return{test:s.test,then:e^s.then,else:e^s.else};if(a==="&&")return{test:s.test,then:e&&s.then,else:o&&s.else};if(a==="||")return{test:s.test,then:e||s.then,else:o||s.else}}else if("value"in o&&"value"in s){if(a==="==")return{value:o.value==s.value};if(a==="===")return{value:o.value===s.value};if(a==="!=")return{value:o.value!=s.value};if(a==="!==")return{value:o.value!==s.value};if(a==="+"){const e={value:o.value+s.value};let t=[];if("wildcards"in o&&o.wildcards){t=t.concat(o.wildcards)}if("wildcards"in s&&s.wildcards){t=t.concat(s.wildcards)}if(t.length>0){e.wildcards=t}return e}if(a==="-")return{value:o.value-s.value};if(a==="*")return{value:o.value*s.value};if(a==="/")return{value:o.value/s.value};if(a==="%")return{value:o.value%s.value};if(a==="<")return{value:o.value")return{value:o.value>s.value};if(a===">=")return{value:o.value>=s.value};if(a==="|")return{value:o.value|s.value};if(a==="&")return{value:o.value&s.value};if(a==="^")return{value:o.value^s.value};if(a==="&&")return{value:o.value&&s.value};if(a==="||")return{value:o.value||s.value}}return},CallExpression:async function CallExpression(e,r){var a;const o=await r(e.callee);if(!o||"test"in o)return;let s=o.value;if(typeof s==="object"&&s!==null)s=s[t.FUNCTION];if(typeof s!=="function")return;let u=null;if(e.callee.object){u=await r(e.callee.object);u=u&&"value"in u&&u.value?u.value:null}let c;let d=[];let f;let p=e.arguments.length>0&&((a=e.callee.property)===null||a===void 0?void 0:a.name)!=="concat";const h=[];for(let a=0,o=e.arguments.length;ah.push(e)))}else{if(!this.computeBranches)return;o={value:t.WILDCARD};h.push(e.arguments[a])}if("test"in o){if(h.length)return;if(c)return;c=o.test;f=d.concat([]);d.push(o.then);f.push(o.else)}else{d.push(o.value);if(f)f.push(o.value)}}if(p)return;try{const e=await s.apply(u,d);if(e===t.UNKNOWN)return;if(!c){if(h.length){if(typeof e!=="string"||countWildcards(e)!==h.length)return;return{value:e,wildcards:h}}return{value:e}}const r=await s.apply(u,f);if(e===t.UNKNOWN)return;return{test:c,then:e,else:r}}catch(e){return}},ConditionalExpression:async function ConditionalExpression(e,t){const r=await t(e.test);if(r&&"value"in r)return r.value?t(e.consequent):t(e.alternate);if(!this.computeBranches)return;const a=await t(e.consequent);if(!a||"wildcards"in a||"test"in a)return;const o=await t(e.alternate);if(!o||"wildcards"in o||"test"in o)return;return{test:e.test,then:a.value,else:o.value}},ExpressionStatement:async function ExpressionStatement(e,t){return t(e.expression)},Identifier:async function Identifier(e,t){if(Object.hasOwnProperty.call(this.vars,e.name))return this.vars[e.name];return undefined},Literal:async function Literal(e,t){return{value:e.value}},MemberExpression:async function MemberExpression(e,r){const a=await r(e.object);if(!a||"test"in a||typeof a.value==="function"){return undefined}if(e.property.type==="Identifier"){if(typeof a.value==="string"&&e.property.name==="concat"){return{value:{[t.FUNCTION]:(...e)=>a.value.concat(e)}}}if(typeof a.value==="object"&&a.value!==null){const o=a.value;if(e.computed){const s=await r(e.property);if(s&&"value"in s&&s.value){const e=o[s.value];if(e===t.UNKNOWN)return undefined;return{value:e}}if(!o[t.UNKNOWN]&&Object.keys(a).length===0){return{value:undefined}}}else if(e.property.name in o){const r=o[e.property.name];if(r===t.UNKNOWN)return undefined;return{value:r}}else if(o[t.UNKNOWN])return undefined}else{return{value:undefined}}}const o=await r(e.property);if(!o||"test"in o)return undefined;if(typeof a.value==="object"&&a.value!==null){if(o.value in a.value){const e=a.value[o.value];if(e===t.UNKNOWN)return undefined;return{value:e}}else if(a.value[t.UNKNOWN]){return undefined}}else{return{value:undefined}}return undefined},MetaProperty:async function MetaProperty(e){if(e.meta.name==="import"&&e.property.name==="meta")return{value:this.vars["import.meta"]};return undefined},NewExpression:async function NewExpression(e,t){const r=await t(e.callee);if(r&&"value"in r&&r.value===a.URL&&e.arguments.length){const r=await t(e.arguments[0]);if(!r)return undefined;let o=null;if(e.arguments[1]){o=await t(e.arguments[1]);if(!o||!("value"in o))return undefined}if("value"in r){if(o){try{return{value:new a.URL(r.value,o.value)}}catch(e){return undefined}}try{return{value:new a.URL(r.value)}}catch(e){return undefined}}else{const e=r.test;if(o){try{return{test:e,then:new a.URL(r.then,o.value),else:new a.URL(r.else,o.value)}}catch(e){return undefined}}try{return{test:e,then:new a.URL(r.then),else:new a.URL(r.else)}}catch(e){return undefined}}}return undefined},ObjectExpression:async function ObjectExpression(e,r){const a={};for(let o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.handleWrappers=void 0;const a=r(7470);function isUndefinedOrVoid(e){return e.type==="Identifier"&&e.name==="undefined"||e.type==="UnaryExpression"&&e.operator==="void"&&e.argument.type==="Literal"&&e.argument.value===0}function handleWrappers(e){var t;let r;if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="UnaryExpression"&&e.body[0].expression.operator==="!"&&e.body[0].expression.argument.type==="CallExpression"&&e.body[0].expression.argument.callee.type==="FunctionExpression"&&e.body[0].expression.argument.arguments.length===1)r=e.body[0].expression.argument;else if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="CallExpression"&&e.body[0].expression.callee.type==="FunctionExpression"&&(e.body[0].expression.arguments.length===1||e.body[0].expression.arguments.length===0))r=e.body[0].expression;else if(e.body.length===1&&e.body[0].type==="ExpressionStatement"&&e.body[0].expression.type==="AssignmentExpression"&&e.body[0].expression.left.type==="MemberExpression"&&e.body[0].expression.left.object.type==="Identifier"&&e.body[0].expression.left.object.name==="module"&&e.body[0].expression.left.property.type==="Identifier"&&e.body[0].expression.left.property.name==="exports"&&e.body[0].expression.right.type==="CallExpression"&&e.body[0].expression.right.callee.type==="FunctionExpression"&&e.body[0].expression.right.arguments.length===1)r=e.body[0].expression.right;if(r){let e;let o;if(r.arguments[0]&&r.arguments[0].type==="ConditionalExpression"&&r.arguments[0].test.type==="LogicalExpression"&&r.arguments[0].test.operator==="&&"&&r.arguments[0].test.left.type==="BinaryExpression"&&r.arguments[0].test.left.operator==="==="&&r.arguments[0].test.left.left.type==="UnaryExpression"&&r.arguments[0].test.left.left.operator==="typeof"&&"name"in r.arguments[0].test.left.left.argument&&r.arguments[0].test.left.left.argument.name==="define"&&r.arguments[0].test.left.right.type==="Literal"&&r.arguments[0].test.left.right.value==="function"&&r.arguments[0].test.right.type==="MemberExpression"&&r.arguments[0].test.right.object.type==="Identifier"&&r.arguments[0].test.right.property.type==="Identifier"&&r.arguments[0].test.right.property.name==="amd"&&r.arguments[0].test.right.computed===false&&r.arguments[0].alternate.type==="FunctionExpression"&&r.arguments[0].alternate.params.length===1&&r.arguments[0].alternate.params[0].type==="Identifier"&&r.arguments[0].alternate.body.body.length===1&&r.arguments[0].alternate.body.body[0].type==="ExpressionStatement"&&r.arguments[0].alternate.body.body[0].expression.type==="AssignmentExpression"&&r.arguments[0].alternate.body.body[0].expression.left.type==="MemberExpression"&&r.arguments[0].alternate.body.body[0].expression.left.object.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.left.object.name==="module"&&r.arguments[0].alternate.body.body[0].expression.left.property.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.left.property.name==="exports"&&r.arguments[0].alternate.body.body[0].expression.left.computed===false&&r.arguments[0].alternate.body.body[0].expression.right.type==="CallExpression"&&r.arguments[0].alternate.body.body[0].expression.right.callee.type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.right.callee.name===r.arguments[0].alternate.params[0].name&&"body"in r.callee&&"body"in r.callee.body&&Array.isArray(r.callee.body.body)&&r.arguments[0].alternate.body.body[0].expression.right.arguments.length===1&&r.arguments[0].alternate.body.body[0].expression.right.arguments[0].type==="Identifier"&&r.arguments[0].alternate.body.body[0].expression.right.arguments[0].name==="require"){let e=r.callee.body.body;if(e[0].type==="ExpressionStatement"&&e[0].expression.type==="Literal"&&e[0].expression.value==="use strict"){e=e.slice(1)}if(e.length===1&&e[0].type==="ExpressionStatement"&&e[0].expression.type==="CallExpression"&&e[0].expression.callee.type==="Identifier"&&e[0].expression.callee.name===r.arguments[0].test.right.object.name&&e[0].expression.arguments.length===1&&e[0].expression.arguments[0].type==="FunctionExpression"&&e[0].expression.arguments[0].params.length===1&&e[0].expression.arguments[0].params[0].type==="Identifier"&&e[0].expression.arguments[0].params[0].name==="require"){const t=e[0].expression.arguments[0];t.params=[];try{delete t.scope.declarations.require}catch(e){}}}else if(r.arguments[0]&&r.arguments[0].type==="FunctionExpression"&&r.arguments[0].params.length===0&&(r.arguments[0].body.body.length===1||r.arguments[0].body.body.length===2&&r.arguments[0].body.body[0].type==="VariableDeclaration"&&r.arguments[0].body.body[0].declarations.length===3&&r.arguments[0].body.body[0].declarations.every((e=>e.init===null&&e.id.type==="Identifier")))&&r.arguments[0].body.body[r.arguments[0].body.body.length-1].type==="ReturnStatement"&&(e=r.arguments[0].body.body[r.arguments[0].body.body.length-1])&&((t=e.argument)===null||t===void 0?void 0:t.type)==="CallExpression"&&e.argument.arguments.length&&e.argument.arguments.every((e=>e&&e.type==="Literal"&&typeof e.value==="number"))&&e.argument.callee.type==="CallExpression"&&(e.argument.callee.callee.type==="FunctionExpression"||e.argument.callee.callee.type==="CallExpression"&&e.argument.callee.callee.callee.type==="FunctionExpression"&&e.argument.callee.callee.arguments.length===0)&&e.argument.callee.arguments.length===3&&e.argument.callee.arguments[0].type==="ObjectExpression"&&e.argument.callee.arguments[1].type==="ObjectExpression"&&e.argument.callee.arguments[2].type==="ArrayExpression"){const t=e.argument.callee.arguments[0].properties;const r={};if(t.every((e=>{if(e.type!=="Property"||e.computed!==false||e.key.type!=="Literal"||typeof e.key.value!=="number"||e.value.type!=="ArrayExpression"||e.value.elements.length!==2||!e.value.elements[0]||!e.value.elements[1]||e.value.elements[0].type!=="FunctionExpression"||e.value.elements[1].type!=="ObjectExpression"){return false}const t=e.value.elements[1].properties;for(const e of t){if(e.type!=="Property"||e.value.type!=="Identifier"&&e.value.type!=="Literal"&&!isUndefinedOrVoid(e.value)||!(e.key.type==="Literal"&&typeof e.key.value==="string"||e.key.type==="Identifier")||e.computed){return false}if(isUndefinedOrVoid(e.value)){if(e.key.type==="Identifier"){r[e.key.name]={type:"Literal",start:e.key.start,end:e.key.end,value:e.key.name,raw:JSON.stringify(e.key.name)}}else if(e.key.type==="Literal"){r[String(e.key.value)]=e.key}}}return true}))){const t=Object.keys(r);const a=e.argument.callee.arguments[1];a.properties=t.map((e=>({type:"Property",method:false,shorthand:false,computed:false,kind:"init",key:r[e],value:{type:"ObjectExpression",properties:[{type:"Property",kind:"init",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"exports"},value:{type:"CallExpression",optional:false,callee:{type:"Identifier",name:"require"},arguments:[r[e]]}}]}})))}}else if(r.arguments[0]&&r.arguments[0].type==="FunctionExpression"&&r.arguments[0].params.length===2&&r.arguments[0].params[0].type==="Identifier"&&r.arguments[0].params[1].type==="Identifier"&&"body"in r.callee&&"body"in r.callee.body&&Array.isArray(r.callee.body.body)&&r.callee.body.body.length===1){const e=r.callee.body.body[0];if(e.type==="IfStatement"&&e.test.type==="LogicalExpression"&&e.test.operator==="&&"&&e.test.left.type==="BinaryExpression"&&e.test.left.left.type==="UnaryExpression"&&e.test.left.left.operator==="typeof"&&e.test.left.left.argument.type==="Identifier"&&e.test.left.left.argument.name==="module"&&e.test.left.right.type==="Literal"&&e.test.left.right.value==="object"&&e.test.right.type==="BinaryExpression"&&e.test.right.left.type==="UnaryExpression"&&e.test.right.left.operator==="typeof"&&e.test.right.left.argument.type==="MemberExpression"&&e.test.right.left.argument.object.type==="Identifier"&&e.test.right.left.argument.object.name==="module"&&e.test.right.left.argument.property.type==="Identifier"&&e.test.right.left.argument.property.name==="exports"&&e.test.right.right.type==="Literal"&&e.test.right.right.value==="object"&&e.consequent.type==="BlockStatement"&&e.consequent.body.length>0){let t;if(e.consequent.body[0].type==="VariableDeclaration"&&e.consequent.body[0].declarations[0].init&&e.consequent.body[0].declarations[0].init.type==="CallExpression")t=e.consequent.body[0].declarations[0].init;else if(e.consequent.body[0].type==="ExpressionStatement"&&e.consequent.body[0].expression.type==="CallExpression")t=e.consequent.body[0].expression;else if(e.consequent.body[0].type==="ExpressionStatement"&&e.consequent.body[0].expression.type==="AssignmentExpression"&&e.consequent.body[0].expression.operator==="="&&e.consequent.body[0].expression.right.type==="CallExpression")t=e.consequent.body[0].expression.right;if(t&&t.callee.type==="Identifier"&&"params"in r.callee&&r.callee.params.length>0&&"name"in r.callee.params[0]&&t.callee.name===r.callee.params[0].name&&t.arguments.length===2&&t.arguments[0].type==="Identifier"&&t.arguments[0].name==="require"&&t.arguments[1].type==="Identifier"&&t.arguments[1].name==="exports"){const e=r.arguments[0];e.params=[];try{const t=e.scope;delete t.declarations.require;delete t.declarations.exports}catch(e){}}}}else if(r.callee.type==="FunctionExpression"&&r.callee.body.body.length>2&&r.callee.body.body[0].type==="VariableDeclaration"&&r.callee.body.body[0].declarations.length===1&&r.callee.body.body[0].declarations[0].type==="VariableDeclarator"&&r.callee.body.body[0].declarations[0].id.type==="Identifier"&&r.callee.body.body[0].declarations[0].init&&(r.callee.body.body[0].declarations[0].init.type==="ObjectExpression"&&r.callee.body.body[0].declarations[0].init.properties.length===0||r.callee.body.body[0].declarations[0].init.type==="CallExpression"&&r.callee.body.body[0].declarations[0].init.arguments.length===1)&&(r.callee.body.body[1]&&r.callee.body.body[1].type==="FunctionDeclaration"&&r.callee.body.body[1].params.length===1&&r.callee.body.body[1].body.body.length>=3||r.callee.body.body[2]&&r.callee.body.body[2].type==="FunctionDeclaration"&&r.callee.body.body[2].params.length===1&&r.callee.body.body[2].body.body.length>=3)&&(r.arguments[0]&&(r.arguments[0].type==="ArrayExpression"&&(o=r.arguments[0])&&r.arguments[0].elements.length>0&&r.arguments[0].elements.every((e=>e&&e.type==="FunctionExpression"))||r.arguments[0].type==="ObjectExpression"&&(o=r.arguments[0])&&r.arguments[0].properties&&r.arguments[0].properties.length>0&&r.arguments[0].properties.every((e=>e&&e.type==="Property"&&!e.computed&&e.key&&e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number")&&e.value&&e.value.type==="FunctionExpression"))))||r.arguments.length===0&&r.callee.type==="FunctionExpression"&&r.callee.params.length===0&&r.callee.body.type==="BlockStatement"&&r.callee.body.body.length>5&&r.callee.body.body[0].type==="VariableDeclaration"&&r.callee.body.body[0].declarations.length===1&&r.callee.body.body[0].declarations[0].id.type==="Identifier"&&r.callee.body.body[1].type==="ExpressionStatement"&&r.callee.body.body[1].expression.type==="AssignmentExpression"&&r.callee.body.body[2].type==="ExpressionStatement"&&r.callee.body.body[2].expression.type==="AssignmentExpression"&&r.callee.body.body[3].type==="ExpressionStatement"&&r.callee.body.body[3].expression.type==="AssignmentExpression"&&r.callee.body.body[3].expression.left.type==="MemberExpression"&&r.callee.body.body[3].expression.left.object.type==="Identifier"&&r.callee.body.body[3].expression.left.object.name===r.callee.body.body[0].declarations[0].id.name&&r.callee.body.body[3].expression.left.property.type==="Identifier"&&r.callee.body.body[3].expression.left.property.name==="modules"&&r.callee.body.body[3].expression.right.type==="ObjectExpression"&&r.callee.body.body[3].expression.right.properties.every((e=>e&&e.type==="Property"&&!e.computed&&e.key&&e.key.type==="Literal"&&(typeof e.key.value==="string"||typeof e.key.value==="number")&&e.value&&e.value.type==="FunctionExpression"))&&(o=r.callee.body.body[3].expression.right)&&(r.callee.body.body[4].type==="VariableDeclaration"&&r.callee.body.body[4].declarations.length===1&&r.callee.body.body[4].declarations[0].init&&r.callee.body.body[4].declarations[0].init.type==="CallExpression"&&r.callee.body.body[4].declarations[0].init.callee.type==="Identifier"&&r.callee.body.body[4].declarations[0].init.callee.name==="require"||r.callee.body.body[5].type==="VariableDeclaration"&&r.callee.body.body[5].declarations.length===1&&r.callee.body.body[5].declarations[0].init&&r.callee.body.body[5].declarations[0].init.type==="CallExpression"&&r.callee.body.body[5].declarations[0].init.callee.type==="Identifier"&&r.callee.body.body[5].declarations[0].init.callee.name==="require")){const e=new Map;let t;if(o.type==="ArrayExpression")t=o.elements.filter((e=>(e===null||e===void 0?void 0:e.type)==="FunctionExpression")).map(((e,t)=>[String(t),e]));else t=o.properties.map((e=>[String(e.key.value),e.value]));for(const[r,a]of t){const t=a.body.body.length===1?a.body.body[0]:(a.body.body.length===2||a.body.body.length===3&&a.body.body[2].type==="EmptyStatement")&&a.body.body[0].type==="ExpressionStatement"&&a.body.body[0].expression.type==="Literal"&&a.body.body[0].expression.value==="use strict"?a.body.body[1]:null;if(t&&t.type==="ExpressionStatement"&&t.expression.type==="AssignmentExpression"&&t.expression.operator==="="&&t.expression.left.type==="MemberExpression"&&t.expression.left.object.type==="Identifier"&&"params"in a&&a.params.length>0&&"name"in a.params[0]&&t.expression.left.object.name===a.params[0].name&&t.expression.left.property.type==="Identifier"&&t.expression.left.property.name==="exports"&&t.expression.right.type==="CallExpression"&&t.expression.right.callee.type==="Identifier"&&t.expression.right.callee.name==="require"&&t.expression.right.arguments.length===1&&t.expression.right.arguments[0].type==="Literal"){e.set(r,t.expression.right.arguments[0].value)}}for(const[,r]of t){if("params"in r&&r.params.length===3&&r.params[2].type==="Identifier"){const t=new Map;a.walk(r.body,{enter(a,o){const s=a;const u=o;if(s.type==="CallExpression"&&s.callee.type==="Identifier"&&"name"in r.params[2]&&s.callee.name===r.params[2].name&&s.arguments.length===1&&s.arguments[0].type==="Literal"){const r=e.get(String(s.arguments[0].value));if(r){const e={type:"CallExpression",optional:false,callee:{type:"Identifier",name:"require"},arguments:[{type:"Literal",value:r}]};const a=u;if("right"in a&&a.right===s){a.right=e}else if("left"in a&&a.left===s){a.left=e}else if("object"in a&&a.object===s){a.object=e}else if("callee"in a&&a.callee===s){a.callee=e}else if("arguments"in a&&a.arguments.some((e=>e===s))){a.arguments=a.arguments.map((t=>t===s?e:t))}else if("init"in a&&a.init===s){if(a.type==="VariableDeclarator"&&a.id.type==="Identifier")t.set(a.id.name,r);a.init=e}}}else if(s.type==="CallExpression"&&s.callee.type==="MemberExpression"&&s.callee.object.type==="Identifier"&&"name"in r.params[2]&&s.callee.object.name===r.params[2].name&&s.callee.property.type==="Identifier"&&s.callee.property.name==="n"&&s.arguments.length===1&&s.arguments[0].type==="Identifier"){if(u&&"init"in u&&u.init===s){const e=s.arguments[0];const t={type:"CallExpression",optional:false,callee:{type:"MemberExpression",computed:false,optional:false,object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"assign"}},arguments:[{type:"ArrowFunctionExpression",expression:true,params:[],body:e},{type:"ObjectExpression",properties:[{type:"Property",kind:"init",method:false,computed:false,shorthand:false,key:{type:"Identifier",name:"a"},value:e}]}]};u.init=t}}}})}}}}}t.handleWrappers=handleWrappers},5920:(e,t)=>{e.exports=t=abbrev.abbrev=abbrev;abbrev.monkeyPatch=monkeyPatch;function monkeyPatch(){Object.defineProperty(Array.prototype,"abbrev",{value:function(){return abbrev(this)},enumerable:false,configurable:true,writable:true});Object.defineProperty(Object.prototype,"abbrev",{value:function(){return abbrev(Object.keys(this))},enumerable:false,configurable:true,writable:true})}function abbrev(e){if(arguments.length!==1||!Array.isArray(e)){e=Array.prototype.slice.call(arguments,0)}for(var t=0,r=e.length,a=[];tt?1:-1}},5534:e=>{"use strict";function isArguments(e){return e!=null&&typeof e==="object"&&e.hasOwnProperty("callee")}var t={"*":{label:"any",check:function(){return true}},A:{label:"array",check:function(e){return Array.isArray(e)||isArguments(e)}},S:{label:"string",check:function(e){return typeof e==="string"}},N:{label:"number",check:function(e){return typeof e==="number"}},F:{label:"function",check:function(e){return typeof e==="function"}},O:{label:"object",check:function(e){return typeof e==="object"&&e!=null&&!t.A.check(e)&&!t.E.check(e)}},B:{label:"boolean",check:function(e){return typeof e==="boolean"}},E:{label:"error",check:function(e){return e instanceof Error}},Z:{label:"null",check:function(e){return e==null}}};function addSchema(e,t){var r=t[e.length]=t[e.length]||[];if(r.indexOf(e)===-1)r.push(e)}var r=e.exports=function(e,r){if(arguments.length!==2)throw wrongNumberOfArgs(["SA"],arguments.length);if(!e)throw missingRequiredArg(0,"rawSchemas");if(!r)throw missingRequiredArg(1,"args");if(!t.S.check(e))throw invalidType(0,["string"],e);if(!t.A.check(r))throw invalidType(1,["array"],r);var a=e.split("|");var o={};a.forEach((function(e){for(var r=0;r{"use strict";t.TrackerGroup=r(2952);t.Tracker=r(6189);t.TrackerStream=r(5849)},8313:(e,t,r)=>{"use strict";var a=r(2361).EventEmitter;var o=r(3837);var s=0;var u=e.exports=function(e){a.call(this);this.id=++s;this.name=e};o.inherits(u,a)},2952:(e,t,r)=>{"use strict";var a=r(3837);var o=r(8313);var s=r(6189);var u=r(5849);var c=e.exports=function(e){o.call(this,e);this.parentGroup=null;this.trackers=[];this.completion={};this.weight={};this.totalWeight=0;this.finished=false;this.bubbleChange=bubbleChange(this)};a.inherits(c,o);function bubbleChange(e){return function(t,r,a){e.completion[a.id]=r;if(e.finished)return;e.emit("change",t||e.name,e.completed(),e)}}c.prototype.nameInTree=function(){var e=[];var t=this;while(t){e.unshift(t.name);t=t.parentGroup}return e.join("/")};c.prototype.addUnit=function(e,t){if(e.addUnit){var r=this;while(r){if(e===r){throw new Error("Attempted to add tracker group "+e.name+" to tree that already includes it "+this.nameInTree(this))}r=r.parentGroup}e.parentGroup=this}this.weight[e.id]=t||1;this.totalWeight+=this.weight[e.id];this.trackers.push(e);this.completion[e.id]=e.completed();e.on("change",this.bubbleChange);if(!this.finished)this.emit("change",e.name,this.completion[e.id],e);return e};c.prototype.completed=function(){if(this.trackers.length===0)return 0;var e=1/this.totalWeight;var t=0;for(var r=0;r{"use strict";var a=r(3837);var o=r(675);var s=r(1722);var u=r(6189);var c=e.exports=function(e,t,r){o.Transform.call(this,r);this.tracker=new u(e,t);this.name=e;this.id=this.tracker.id;this.tracker.on("change",delegateChange(this))};a.inherits(c,o.Transform);function delegateChange(e){return function(t,r,a){e.emit("change",t,r,e)}}c.prototype._transform=function(e,t,r){this.tracker.completeWork(e.length?e.length:1);this.push(e);r()};c.prototype._flush=function(e){this.tracker.finish();e()};s(c.prototype,"tracker").method("completed").method("addWork").method("finish")},6189:(e,t,r)=>{"use strict";var a=r(3837);var o=r(8313);var s=e.exports=function(e,t){o.call(this,e);this.workDone=0;this.workTodo=t||0};a.inherits(s,o);s.prototype.completed=function(){return this.workTodo===0?0:this.workDone/this.workTodo};s.prototype.addWork=function(e){this.workTodo+=e;this.emit("change",this.name,this.completed(),this)};s.prototype.completeWork=function(e){this.workDone+=e;if(this.workDone>this.workTodo)this.workDone=this.workTodo;this.emit("change",this.name,this.completed(),this)};s.prototype.finish=function(){this.workTodo=this.workDone=1;this.emit("change",this.name,1,this)}},5706:(module,exports,__nccwpck_require__)=>{var fs=__nccwpck_require__(7147),path=__nccwpck_require__(1017),fileURLToPath=__nccwpck_require__(9001),join=path.join,dirname=path.dirname,exists=fs.accessSync&&function(e){try{fs.accessSync(e)}catch(e){return false}return true}||fs.existsSync||path.existsSync,defaults={arrow:process.env.NODE_BINDINGS_ARROW||" → ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function bindings(opts){if(typeof opts=="string"){opts={bindings:opts}}else if(!opts){opts={}}Object.keys(defaults).map((function(e){if(!(e in opts))opts[e]=defaults[e]}));if(!opts.module_root){opts.module_root=exports.getRoot(exports.getFileName())}if(path.extname(opts.bindings)!=".node"){opts.bindings+=".node"}var requireFunc=true?eval("require"):0;var tries=[],i=0,l=opts.try.length,n,b,err;for(;i{"use strict";e.exports=function(e,t){if(e===null||e===undefined){throw TypeError()}e=String(e);var r=e.length;var a=t?Number(t):0;if(Number.isNaN(a)){a=0}if(a<0||a>=r){return undefined}var o=e.charCodeAt(a);if(o>=55296&&o<=56319&&r>a+1){var s=e.charCodeAt(a+1);if(s>=56320&&s<=57343){return(o-55296)*1024+s-56320+65536}}return o}},6322:(e,t)=>{"use strict";var r="[";t.up=function up(e){return r+(e||"")+"A"};t.down=function down(e){return r+(e||"")+"B"};t.forward=function forward(e){return r+(e||"")+"C"};t.back=function back(e){return r+(e||"")+"D"};t.nextLine=function nextLine(e){return r+(e||"")+"E"};t.previousLine=function previousLine(e){return r+(e||"")+"F"};t.horizontalAbsolute=function horizontalAbsolute(e){if(e==null)throw new Error("horizontalAboslute requires a column to position to");return r+e+"G"};t.eraseData=function eraseData(){return r+"J"};t.eraseLine=function eraseLine(){return r+"K"};t.goto=function(e,t){return r+t+";"+e+"H"};t.gotoSOL=function(){return"\r"};t.beep=function(){return""};t.hideCursor=function hideCursor(){return r+"?25l"};t.showCursor=function showCursor(){return r+"?25h"};var a={reset:0,bold:1,italic:3,underline:4,inverse:7,stopBold:22,stopItalic:23,stopUnderline:24,stopInverse:27,white:37,black:30,blue:34,cyan:36,green:32,magenta:35,red:31,yellow:33,bgWhite:47,bgBlack:40,bgBlue:44,bgCyan:46,bgGreen:42,bgMagenta:45,bgRed:41,bgYellow:43,grey:90,brightBlack:90,brightRed:91,brightGreen:92,brightYellow:93,brightBlue:94,brightMagenta:95,brightCyan:96,brightWhite:97,bgGrey:100,bgBrightBlack:100,bgBrightRed:101,bgBrightGreen:102,bgBrightYellow:103,bgBrightBlue:104,bgBrightMagenta:105,bgBrightCyan:106,bgBrightWhite:107};t.color=function color(e){if(arguments.length!==1||!Array.isArray(e)){e=Array.prototype.slice.call(arguments)}return r+e.map(colorNameToCode).join(";")+"m"};function colorNameToCode(e){if(a[e]!=null)return a[e];throw new Error("Unknown color or style name: "+e)}},3487:(e,t)=>{function isArray(e){if(Array.isArray){return Array.isArray(e)}return objectToString(e)==="[object Array]"}t.isArray=isArray;function isBoolean(e){return typeof e==="boolean"}t.isBoolean=isBoolean;function isNull(e){return e===null}t.isNull=isNull;function isNullOrUndefined(e){return e==null}t.isNullOrUndefined=isNullOrUndefined;function isNumber(e){return typeof e==="number"}t.isNumber=isNumber;function isString(e){return typeof e==="string"}t.isString=isString;function isSymbol(e){return typeof e==="symbol"}t.isSymbol=isSymbol;function isUndefined(e){return e===void 0}t.isUndefined=isUndefined;function isRegExp(e){return objectToString(e)==="[object RegExp]"}t.isRegExp=isRegExp;function isObject(e){return typeof e==="object"&&e!==null}t.isObject=isObject;function isDate(e){return objectToString(e)==="[object Date]"}t.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}t.isError=isError;function isFunction(e){return typeof e==="function"}t.isFunction=isFunction;function isPrimitive(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}t.isPrimitive=isPrimitive;t.isBuffer=Buffer.isBuffer;function objectToString(e){return Object.prototype.toString.call(e)}},1722:e=>{e.exports=Delegator;function Delegator(e,t){if(!(this instanceof Delegator))return new Delegator(e,t);this.proto=e;this.target=t;this.methods=[];this.getters=[];this.setters=[];this.fluents=[]}Delegator.prototype.method=function(e){var t=this.proto;var r=this.target;this.methods.push(e);t[e]=function(){return this[r][e].apply(this[r],arguments)};return this};Delegator.prototype.access=function(e){return this.getter(e).setter(e)};Delegator.prototype.getter=function(e){var t=this.proto;var r=this.target;this.getters.push(e);t.__defineGetter__(e,(function(){return this[r][e]}));return this};Delegator.prototype.setter=function(e){var t=this.proto;var r=this.target;this.setters.push(e);t.__defineSetter__(e,(function(t){return this[r][e]=t}));return this};Delegator.prototype.fluent=function(e){var t=this.proto;var r=this.target;this.fluents.push(e);t[e]=function(t){if("undefined"!=typeof t){this[r][e]=t;return this}else{return this[r][e]}};return this}},2157:(e,t,r)=>{"use strict";var a=r(2037).platform();var o=r(2081).spawnSync;var s=r(7147).readdirSync;var u="glibc";var c="musl";var d={encoding:"utf8",env:process.env};if(!o){o=function(){return{status:126,stdout:"",stderr:""}}}function contains(e){return function(t){return t.indexOf(e)!==-1}}function versionFromMuslLdd(e){return e.split(/[\r\n]+/)[1].trim().split(/\s/)[1]}function safeReaddirSync(e){try{return s(e)}catch(e){}return[]}var f="";var p="";var h="";if(a==="linux"){var v=o("getconf",["GNU_LIBC_VERSION"],d);if(v.status===0){f=u;p=v.stdout.trim().split(" ")[1];h="getconf"}else{var _=o("ldd",["--version"],d);if(_.status===0&&_.stdout.indexOf(c)!==-1){f=c;p=versionFromMuslLdd(_.stdout);h="ldd"}else if(_.status===1&&_.stderr.indexOf(c)!==-1){f=c;p=versionFromMuslLdd(_.stderr);h="ldd"}else{var g=safeReaddirSync("/lib");if(g.some(contains("-linux-gnu"))){f=u;h="filesystem"}else if(g.some(contains("libc.musl-"))){f=c;h="filesystem"}else if(g.some(contains("ld-musl-"))){f=c;h="filesystem"}else{var y=safeReaddirSync("/usr/sbin");if(y.some(contains("glibc"))){f=u;h="filesystem"}}}}}var m=f!==""&&f!==u;e.exports={GLIBC:u,MUSL:c,family:f,version:p,method:h,isNonGlibcLinux:m}},9001:(e,t,r)=>{var a=r(1017).sep||"/";e.exports=fileUriToPath;function fileUriToPath(e){if("string"!=typeof e||e.length<=7||"file://"!=e.substring(0,7)){throw new TypeError("must pass in a file:// URI to convert to a file path")}var t=decodeURI(e.substring(7));var r=t.indexOf("/");var o=t.substring(0,r);var s=t.substring(r+1);if("localhost"==o)o="";if(o){o=a+a+o}s=s.replace(/^(.+)\|/,"$1:");if(a=="\\"){s=s.replace(/\//g,"\\")}if(/^.+\:/.test(s)){}else{s=a+s}return o+s}},1271:(e,t,r)=>{"use strict";var a=r(1021);var o=r(5791);e.exports={activityIndicator:function(e,t,r){if(e.spun==null)return;return a(t,e.spun)},progressbar:function(e,t,r){if(e.completed==null)return;return o(t,r,e.completed)}}},2479:(e,t,r)=>{"use strict";var a=r(3837);var o=t.User=function User(e){var t=new Error(e);Error.captureStackTrace(t,User);t.code="EGAUGE";return t};t.MissingTemplateValue=function MissingTemplateValue(e,t){var r=new o(a.format('Missing template value "%s"',e.type));Error.captureStackTrace(r,MissingTemplateValue);r.template=e;r.values=t;return r};t.Internal=function Internal(e){var t=new Error(e);Error.captureStackTrace(t,Internal);t.code="EGAUGEINTERNAL";return t}},3278:e=>{"use strict";e.exports=isWin32()||isColorTerm();function isWin32(){return process.platform==="win32"}function isColorTerm(){var e=/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i;return!!process.env.COLORTERM||e.test(process.env.TERM)}},6054:(e,t,r)=>{"use strict";var a=r(4708);var o=r(7963);var s=r(3278);var u=r(2028);var c=r(7987);var d=r(75);var f=r(9186);var p=r(6401);e.exports=Gauge;function callWith(e,t){return function(){return t.call(e)}}function Gauge(e,t){var r,o;if(e&&e.write){o=e;r=t||{}}else if(t&&t.write){o=t;r=e||{}}else{o=f.stderr;r=e||t||{}}this._status={spun:0,section:"",subsection:""};this._paused=false;this._disabled=true;this._showing=false;this._onScreen=false;this._needsRedraw=false;this._hideCursor=r.hideCursor==null?true:r.hideCursor;this._fixedFramerate=r.fixedFramerate==null?!/^v0\.8\./.test(f.version):r.fixedFramerate;this._lastUpdateAt=null;this._updateInterval=r.updateInterval==null?50:r.updateInterval;this._themes=r.themes||c;this._theme=r.theme;var s=this._computeTheme(r.theme);var u=r.template||[{type:"progressbar",length:20},{type:"activityIndicator",kerning:1,length:1},{type:"section",kerning:1,default:""},{type:"subsection",kerning:1,default:""}];this.setWriteTo(o,r.tty);var d=r.Plumbing||a;this._gauge=new d(s,u,this.getWidth());this._$$doRedraw=callWith(this,this._doRedraw);this._$$handleSizeChange=callWith(this,this._handleSizeChange);this._cleanupOnExit=r.cleanupOnExit==null||r.cleanupOnExit;this._removeOnExit=null;if(r.enabled||r.enabled==null&&this._tty&&this._tty.isTTY){this.enable()}else{this.disable()}}Gauge.prototype={};Gauge.prototype.isEnabled=function(){return!this._disabled};Gauge.prototype.setTemplate=function(e){this._gauge.setTemplate(e);if(this._showing)this._requestRedraw()};Gauge.prototype._computeTheme=function(e){if(!e)e={};if(typeof e==="string"){e=this._themes.getTheme(e)}else if(e&&(Object.keys(e).length===0||e.hasUnicode!=null||e.hasColor!=null)){var t=e.hasUnicode==null?o():e.hasUnicode;var r=e.hasColor==null?s:e.hasColor;e=this._themes.getDefault({hasUnicode:t,hasColor:r,platform:e.platform})}return e};Gauge.prototype.setThemeset=function(e){this._themes=e;this.setTheme(this._theme)};Gauge.prototype.setTheme=function(e){this._gauge.setTheme(this._computeTheme(e));if(this._showing)this._requestRedraw();this._theme=e};Gauge.prototype._requestRedraw=function(){this._needsRedraw=true;if(!this._fixedFramerate)this._doRedraw()};Gauge.prototype.getWidth=function(){return(this._tty&&this._tty.columns||80)-1};Gauge.prototype.setWriteTo=function(e,t){var r=!this._disabled;if(r)this.disable();this._writeTo=e;this._tty=t||e===f.stderr&&f.stdout.isTTY&&f.stdout||e.isTTY&&e||this._tty;if(this._gauge)this._gauge.setWidth(this.getWidth());if(r)this.enable()};Gauge.prototype.enable=function(){if(!this._disabled)return;this._disabled=false;if(this._tty)this._enableEvents();if(this._showing)this.show()};Gauge.prototype.disable=function(){if(this._disabled)return;if(this._showing){this._lastUpdateAt=null;this._showing=false;this._doRedraw();this._showing=true}this._disabled=true;if(this._tty)this._disableEvents()};Gauge.prototype._enableEvents=function(){if(this._cleanupOnExit){this._removeOnExit=u(callWith(this,this.disable))}this._tty.on("resize",this._$$handleSizeChange);if(this._fixedFramerate){this.redrawTracker=d(this._$$doRedraw,this._updateInterval);if(this.redrawTracker.unref)this.redrawTracker.unref()}};Gauge.prototype._disableEvents=function(){this._tty.removeListener("resize",this._$$handleSizeChange);if(this._fixedFramerate)clearInterval(this.redrawTracker);if(this._removeOnExit)this._removeOnExit()};Gauge.prototype.hide=function(e){if(this._disabled)return e&&f.nextTick(e);if(!this._showing)return e&&f.nextTick(e);this._showing=false;this._doRedraw();e&&p(e)};Gauge.prototype.show=function(e,t){this._showing=true;if(typeof e==="string"){this._status.section=e}else if(typeof e==="object"){var r=Object.keys(e);for(var a=0;a{"use strict";var a=r(8753);e.exports=function(e){if(a(e)){return false}if(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)){return true}return false}},5511:(e,t,r)=>{"use strict";var a=r(7518);var o=r(6708);var s=r(6062);e.exports=function(e){if(typeof e!=="string"||e.length===0){return 0}var t=0;e=a(e);for(var r=0;r=127&&u<=159){continue}if(u>=65536){r++}if(s(u)){t+=2}else{t++}}return t}},4708:(e,t,r)=>{"use strict";var a=r(6322);var o=r(4293);var s=r(5534);var u=e.exports=function(e,t,r){if(!r)r=80;s("OAN",[e,t,r]);this.showing=false;this.theme=e;this.width=r;this.template=t};u.prototype={};u.prototype.setTheme=function(e){s("O",[e]);this.theme=e};u.prototype.setTemplate=function(e){s("A",[e]);this.template=e};u.prototype.setWidth=function(e){s("N",[e]);this.width=e};u.prototype.hide=function(){return a.gotoSOL()+a.eraseLine()};u.prototype.hideCursor=a.hideCursor;u.prototype.showCursor=a.showCursor;u.prototype.show=function(e){var t=Object.create(this.theme);for(var r in e){t[r]=e[r]}return o(this.width,this.template,t).trim()+a.color("reset")+a.eraseLine()+a.gotoSOL()}},9186:e=>{"use strict";e.exports=process},5791:(e,t,r)=>{"use strict";var a=r(5534);var o=r(4293);var s=r(2343);var u=r(5511);e.exports=function(e,t,r){a("ONN",[e,t,r]);if(r<0)r=0;if(r>1)r=1;if(t<=0)return"";var s=Math.round(t*r);var u=t-s;var c=[{type:"complete",value:repeat(e.complete,s),length:s},{type:"remaining",value:repeat(e.remaining,u),length:u}];return o(t,c,e)};function repeat(e,t){var r="";var a=t;do{if(a%2){r+=e}a=Math.floor(a/2);e+=e}while(a&&u(r){"use strict";var a=r(7568);var o=r(5534);var s=r(1800);var u=r(2343);var c=r(2479);var d=r(5205);function renderValueWithValues(e){return function(t){return renderValue(t,e)}}var f=e.exports=function(e,t,r){var o=prepareItems(e,t,r);var s=o.map(renderValueWithValues(r)).join("");return a.left(u(s,e),e)};function preType(e){var t=e.type[0].toUpperCase()+e.type.slice(1);return"pre"+t}function postType(e){var t=e.type[0].toUpperCase()+e.type.slice(1);return"post"+t}function hasPreOrPost(e,t){if(!e.type)return;return t[preType(e)]||t[postType(e)]}function generatePreAndPost(e,t){var r=s({},e);var a=Object.create(t);var o=[];var u=preType(r);var c=postType(r);if(a[u]){o.push({value:a[u]});a[u]=null}r.minLength=null;r.length=null;r.maxLength=null;o.push(r);a[r.type]=a[r.type];if(a[c]){o.push({value:a[c]});a[c]=null}return function(e,t,r){return f(r,o,a)}}function prepareItems(e,t,r){function cloneAndObjectify(t,a,o){var s=new d(t,e);var u=s.type;if(s.value==null){if(!(u in r)){if(s.default==null){throw new c.MissingTemplateValue(s,r)}else{s.value=s.default}}else{s.value=r[u]}}if(s.value==null||s.value==="")return null;s.index=a;s.first=a===0;s.last=a===o.length-1;if(hasPreOrPost(s,r))s.value=generatePreAndPost(s,r);return s}var a=t.map(cloneAndObjectify).filter((function(e){return e!=null}));var o=0;var s=e;var u=a.length;function consumeSpace(e){if(e>s)e=s;o+=e;s-=e}function finishSizing(e,t){if(e.finished)throw new c.Internal("Tried to finish template item that was already finished");if(t===Infinity)throw new c.Internal("Length of template item cannot be infinity");if(t!=null)e.length=t;e.minLength=null;e.maxLength=null;--u;e.finished=true;if(e.length==null)e.length=e.getBaseLength();if(e.length==null)throw new c.Internal("Finished template items must have a length");consumeSpace(e.getLength())}a.forEach((function(e){if(!e.kerning)return;var t=e.first?0:a[e.index-1].padRight;if(!e.first&&t=h){finishSizing(e,e.minLength);p=true}}))}while(p&&f++{"use strict";var a=r(9186);try{e.exports=setImmediate}catch(t){e.exports=a.nextTick}},75:e=>{"use strict";e.exports=setInterval},1021:e=>{"use strict";e.exports=function spin(e,t){return e[t%e.length]}},5205:(e,t,r)=>{"use strict";var a=r(5511);e.exports=TemplateItem;function isPercent(e){if(typeof e!=="string")return false;return e.slice(-1)==="%"}function percent(e){return Number(e.slice(0,-1))/100}function TemplateItem(e,t){this.overallOutputLength=t;this.finished=false;this.type=null;this.value=null;this.length=null;this.maxLength=null;this.minLength=null;this.kerning=null;this.align="left";this.padLeft=0;this.padRight=0;this.index=null;this.first=null;this.last=null;if(typeof e==="string"){this.value=e}else{for(var r in e)this[r]=e[r]}if(isPercent(this.length)){this.length=Math.round(this.overallOutputLength*percent(this.length))}if(isPercent(this.minLength)){this.minLength=Math.round(this.overallOutputLength*percent(this.minLength))}if(isPercent(this.maxLength)){this.maxLength=Math.round(this.overallOutputLength*percent(this.maxLength))}return this}TemplateItem.prototype={};TemplateItem.prototype.getBaseLength=function(){var e=this.length;if(e==null&&typeof this.value==="string"&&this.maxLength==null&&this.minLength==null){e=a(this.value)}return e};TemplateItem.prototype.getLength=function(){var e=this.getBaseLength();if(e==null)return null;return e+this.padLeft+this.padRight};TemplateItem.prototype.getMaxLength=function(){if(this.maxLength==null)return null;return this.maxLength+this.padLeft+this.padRight};TemplateItem.prototype.getMinLength=function(){if(this.minLength==null)return null;return this.minLength+this.padLeft+this.padRight}},3117:(e,t,r)=>{"use strict";var a=r(1800);e.exports=function(){return o.newThemeSet()};var o={};o.baseTheme=r(1271);o.newTheme=function(e,t){if(!t){t=e;e=this.baseTheme}return a({},e,t)};o.getThemeNames=function(){return Object.keys(this.themes)};o.addTheme=function(e,t,r){this.themes[e]=this.newTheme(t,r)};o.addToAllThemes=function(e){var t=this.themes;Object.keys(t).forEach((function(r){a(t[r],e)}));a(this.baseTheme,e)};o.getTheme=function(e){if(!this.themes[e])throw this.newMissingThemeError(e);return this.themes[e]};o.setDefault=function(e,t){if(t==null){t=e;e={}}var r=e.platform==null?"fallback":e.platform;var a=!!e.hasUnicode;var o=!!e.hasColor;if(!this.defaults[r])this.defaults[r]={true:{},false:{}};this.defaults[r][a][o]=t};o.getDefault=function(e){if(!e)e={};var t=e.platform||process.platform;var r=this.defaults[t]||this.defaults.fallback;var o=!!e.hasUnicode;var s=!!e.hasColor;if(!r)throw this.newMissingDefaultThemeError(t,o,s);if(!r[o][s]){if(o&&s&&r[!o][s]){o=false}else if(o&&s&&r[o][!s]){s=false}else if(o&&s&&r[!o][!s]){o=false;s=false}else if(o&&!s&&r[!o][s]){o=false}else if(!o&&s&&r[o][!s]){s=false}else if(r===this.defaults.fallback){throw this.newMissingDefaultThemeError(t,o,s)}}if(r[o][s]){return this.getTheme(r[o][s])}else{return this.getDefault(a({},e,{platform:"fallback"}))}};o.newMissingThemeError=function newMissingThemeError(e){var t=new Error('Could not find a gauge theme named "'+e+'"');Error.captureStackTrace.call(t,newMissingThemeError);t.theme=e;t.code="EMISSINGTHEME";return t};o.newMissingDefaultThemeError=function newMissingDefaultThemeError(e,t,r){var a=new Error("Could not find a gauge theme for your platform/unicode/color use combo:\n"+" platform = "+e+"\n"+" hasUnicode = "+t+"\n"+" hasColor = "+r);Error.captureStackTrace.call(a,newMissingDefaultThemeError);a.platform=e;a.hasUnicode=t;a.hasColor=r;a.code="EMISSINGTHEME";return a};o.newThemeSet=function(){var themeset=function(e){return themeset.getDefault(e)};return a(themeset,o,{themes:a({},this.themes),baseTheme:a({},this.baseTheme),defaults:JSON.parse(JSON.stringify(this.defaults||{}))})}},7987:(e,t,r)=>{"use strict";var a=r(6322);var o=r(3117);var s=e.exports=new o;s.addTheme("ASCII",{preProgressbar:"[",postProgressbar:"]",progressbarTheme:{complete:"#",remaining:"."},activityIndicatorTheme:"-\\|/",preSubsection:">"});s.addTheme("colorASCII",s.getTheme("ASCII"),{progressbarTheme:{preComplete:a.color("inverse"),complete:" ",postComplete:a.color("stopInverse"),preRemaining:a.color("brightBlack"),remaining:".",postRemaining:a.color("reset")}});s.addTheme("brailleSpinner",{preProgressbar:"⸨",postProgressbar:"⸩",progressbarTheme:{complete:"░",remaining:"⠂"},activityIndicatorTheme:"⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏",preSubsection:">"});s.addTheme("colorBrailleSpinner",s.getTheme("brailleSpinner"),{progressbarTheme:{preComplete:a.color("inverse"),complete:" ",postComplete:a.color("stopInverse"),preRemaining:a.color("brightBlack"),remaining:"░",postRemaining:a.color("reset")}});s.setDefault({},"ASCII");s.setDefault({hasColor:true},"colorASCII");s.setDefault({platform:"darwin",hasUnicode:true},"brailleSpinner");s.setDefault({platform:"darwin",hasUnicode:true,hasColor:true},"colorBrailleSpinner")},2343:(e,t,r)=>{"use strict";var a=r(5511);var o=r(7518);e.exports=wideTruncate;function wideTruncate(e,t){if(a(e)===0)return e;if(t<=0)return"";if(a(e)<=t)return e;var r=o(e);var s=e.length+r.length;var u=e.slice(0,t+s);while(a(u)>t){u=u.slice(0,-1)}return u}},9132:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}));return r}},552:(e,t,r)=>{var a=r(7147);var o=r(1290);var s=r(4410);var u=r(9132);var c=r(3837);var d;var f;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){d=Symbol.for("graceful-fs.queue");f=Symbol.for("graceful-fs.previous")}else{d="___graceful-fs.queue";f="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,d,{get:function(){return t}})}var p=noop;if(c.debuglog)p=c.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var e=c.format.apply(c,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!a[d]){var h=global[d]||[];publishQueue(a,h);a.close=function(e){function close(t,r){return e.call(a,t,(function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,f,{value:e});return close}(a.close);a.closeSync=function(e){function closeSync(t){e.apply(a,arguments);resetQueue()}Object.defineProperty(closeSync,f,{value:e});return closeSync}(a.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(a[d]);r(9491).equal(a[d].length,0)}))}}if(!global[d]){publishQueue(global,a[d])}e.exports=patch(u(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched){e.exports=patch(a);a.__patched=true}function patch(e){o(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,a){if(typeof r==="function")a=r,r=null;return go$readFile(e,r,a);function go$readFile(e,r,a,o){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,a],t,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,a,o){if(typeof a==="function")o=a,a=null;return go$writeFile(e,t,a,o);function go$writeFile(e,t,a,o,s){return r(e,t,a,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,a,o],r,s||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var a=e.appendFile;if(a)e.appendFile=appendFile;function appendFile(e,t,r,o){if(typeof r==="function")o=r,r=null;return go$appendFile(e,t,r,o);function go$appendFile(e,t,r,o,s){return a(e,t,r,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,o],a,s||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var u=e.copyFile;if(u)e.copyFile=copyFile;function copyFile(e,t,r,a){if(typeof r==="function"){a=r;r=0}return go$copyFile(e,t,r,a);function go$copyFile(e,t,r,a,o){return u(e,t,r,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,a],s,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var c=e.readdir;e.readdir=readdir;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;return go$readdir(e,t,r);function go$readdir(e,t,r,a){return c(e,t,(function(o,s){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$readdir,[e,t,r],o,a||Date.now(),Date.now()]);else{if(s&&s.sort)s.sort();if(typeof r==="function")r.call(this,o,s)}}))}}if(process.version.substr(0,4)==="v0.8"){var d=s(e);ReadStream=d.ReadStream;WriteStream=d.WriteStream}var f=e.ReadStream;if(f){ReadStream.prototype=Object.create(f.prototype);ReadStream.prototype.open=ReadStream$open}var p=e.WriteStream;if(p){WriteStream.prototype=Object.create(p.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var h=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});var v=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return v},set:function(e){v=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return f.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return p.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var _=e.open;e.open=open;function open(e,t,r,a){if(typeof r==="function")a=r,r=null;return go$open(e,t,r,a);function go$open(e,t,r,a,o){return _(e,t,r,(function(s,u){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$open,[e,t,r,a],s,o||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}return e}function enqueue(e){p("ENQUEUE",e[0].name,e[1]);a[d].push(e);retry()}var v;function resetQueue(){var e=Date.now();for(var t=0;t2){a[d][t][3]=e;a[d][t][4]=e}}retry()}function retry(){clearTimeout(v);v=undefined;if(a[d].length===0)return;var e=a[d].shift();var t=e[0];var r=e[1];var o=e[2];var s=e[3];var u=e[4];if(s===undefined){p("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-s>=6e4){p("TIMEOUT",t.name,r);var c=r.pop();if(typeof c==="function")c.call(null,o)}else{var f=Date.now()-u;var h=Math.max(u-s,1);var _=Math.min(h*1.2,100);if(f>=_){p("RETRY",t.name,r);t.apply(null,r.concat([s]))}else{a[d].push(e)}}if(v===undefined){v=setTimeout(retry,0)}}},4410:(e,t,r)=>{var a=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);a.call(this);var o=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var s=Object.keys(r);for(var u=0,c=s.length;uthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){o._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){o.emit("error",e);o.readable=false;return}o.fd=t;o.emit("open",t);o._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);a.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var o=Object.keys(r);for(var s=0,u=o.length;s= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},1290:(e,t,r)=>{var a=r(2057);var o=process.cwd;var s=null;var u=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!s)s=o.call(process);return s};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var c=process.chdir;process.chdir=function(e){s=null;c.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,c)}e.exports=patch;function patch(e){if(a.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,r,a){if(a)process.nextTick(a)};e.lchownSync=function(){}}if(u==="win32"){e.rename=function(t){return function(r,a,o){var s=Date.now();var u=0;t(r,a,(function CB(c){if(c&&(c.code==="EACCES"||c.code==="EPERM")&&Date.now()-s<6e4){setTimeout((function(){e.stat(a,(function(e,s){if(e&&e.code==="ENOENT")t(r,a,CB);else o(c)}))}),u);if(u<100)u+=10;return}if(o)o(c)}))}}(e.rename)}e.read=function(t){function read(r,a,o,s,u,c){var d;if(c&&typeof c==="function"){var f=0;d=function(p,h,v){if(p&&p.code==="EAGAIN"&&f<10){f++;return t.call(e,r,a,o,s,u,d)}c.apply(this,arguments)}}return t.call(e,r,a,o,s,u,d)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=function(t){return function(r,a,o,s,u){var c=0;while(true){try{return t.call(e,r,a,o,s,u)}catch(e){if(e.code==="EAGAIN"&&c<10){c++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,o){e.open(t,a.O_WRONLY|a.O_SYMLINK,r,(function(t,a){if(t){if(o)o(t);return}e.fchmod(a,r,(function(t){e.close(a,(function(e){if(o)o(t||e)}))}))}))};e.lchmodSync=function(t,r){var o=e.openSync(t,a.O_WRONLY|a.O_SYMLINK,r);var s=true;var u;try{u=e.fchmodSync(o,r);s=false}finally{if(s){try{e.closeSync(o)}catch(e){}}else{e.closeSync(o)}}return u}}function patchLutimes(e){if(a.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,r,o,s){e.open(t,a.O_SYMLINK,(function(t,a){if(t){if(s)s(t);return}e.futimes(a,r,o,(function(t){e.close(a,(function(e){if(s)s(t||e)}))}))}))};e.lutimesSync=function(t,r,o){var s=e.openSync(t,a.O_SYMLINK);var u;var c=true;try{u=e.futimesSync(s,r,o);c=false}finally{if(c){try{e.closeSync(s)}catch(e){}}else{e.closeSync(s)}}return u}}else{e.lutimes=function(e,t,r,a){if(a)process.nextTick(a)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,a,o){return t.call(e,r,a,(function(e){if(chownErOk(e))e=null;if(o)o.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,a){try{return t.call(e,r,a)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,a,o,s){return t.call(e,r,a,o,(function(e){if(chownErOk(e))e=null;if(s)s.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,a,o){try{return t.call(e,r,a,o)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,a,o){if(typeof a==="function"){o=a;a=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(o)o.apply(this,arguments)}return a?t.call(e,r,a,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,a){var o=a?t.call(e,r,a):t.call(e,r);if(o){if(o.uid<0)o.uid+=4294967296;if(o.gid<0)o.gid+=4294967296}return o}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},7963:(e,t,r)=>{"use strict";var a=r(2037);var o=e.exports=function(){if(a.type()=="Windows_NT"){return false}var e=/UTF-?8$/i;var t=process.env.LC_ALL||process.env.LC_CTYPE||process.env.LANG;return e.test(t)}},6919:(e,t,r)=>{try{var a=r(3837);if(typeof a.inherits!=="function")throw"";e.exports=a.inherits}catch(t){e.exports=r(7526)}},7526:e=>{if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},9842:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return t.call(e)=="[object Array]"}},3277:(module,__unused_webpack_exports,__nccwpck_require__)=>{var fs=__nccwpck_require__(7147);var path=__nccwpck_require__(1017);var os=__nccwpck_require__(2037);var runtimeRequire=true?eval("require"):0;var vars=process.config&&process.config.variables||{};var prebuildsOnly=!!process.env.PREBUILDS_ONLY;var abi=process.versions.modules;var runtime=isElectron()?"electron":"node";var arch=os.arch();var platform=os.platform();var libc=process.env.LIBC||(isAlpine(platform)?"musl":"glibc");var armv=process.env.ARM_VERSION||(arch==="arm64"?"8":vars.arm_version)||"";var uv=(process.versions.uv||"").split(".")[0];module.exports=load;function load(e){return runtimeRequire(load.path(e))}load.path=function(e){e=path.resolve(e||".");try{var t=runtimeRequire(path.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");if(process.env[t+"_PREBUILD"])e=process.env[t+"_PREBUILD"]}catch(e){}if(!prebuildsOnly){var r=getFirst(path.join(e,"build/Release"),matchBuild);if(r)return r;var a=getFirst(path.join(e,"build/Debug"),matchBuild);if(a)return a}var o=resolve(e);if(o)return o;var s=resolve(path.dirname(process.execPath));if(s)return s;var u=["platform="+platform,"arch="+arch,"runtime="+runtime,"abi="+abi,"uv="+uv,armv?"armv="+armv:"","libc="+libc,"node="+process.versions.node,process.versions&&process.versions.electron?"electron="+process.versions.electron:"",true?"webpack=true":0].filter(Boolean).join(" ");throw new Error("No native build was found for "+u+"\n loaded from: "+e+"\n");function resolve(e){var t=path.join(e,"prebuilds",platform+"-"+arch);var r=readdirSync(t).map(parseTags);var a=r.filter(matchTags(runtime,abi));var o=a.sort(compareTags(runtime))[0];if(o)return path.join(t,o.file)}};function readdirSync(e){try{return fs.readdirSync(e)}catch(e){return[]}}function getFirst(e,t){var r=readdirSync(e).filter(t);return r[0]&&path.join(e,r[0])}function matchBuild(e){return/\.node$/.test(e)}function parseTags(e){var t=e.split(".");var r=t.pop();var a={file:e,specificity:0};if(r!=="node")return;for(var o=0;or.specificity?-1:1}else{return 0}}}function isElectron(){if(process.versions&&process.versions.electron)return true;if(process.env.ELECTRON_RUN_AS_NODE)return true;return typeof window!=="undefined"&&window.process&&window.process.type==="renderer"}function isAlpine(e){return e==="linux"&&fs.existsSync("/etc/alpine-release")}load.parseTags=parseTags;load.matchTags=matchTags;load.compareTags=compareTags},9248:(e,t,r)=>{"use strict";var a=r(7147);var o=r(3632);var s=r(9658);e.exports=t;var u=process.version.substr(1).replace(/-.*$/,"").split(".").map((function(e){return+e}));var c=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];var d="napi_build_version=";e.exports.get_napi_version=function(e){var t=process.versions.napi;if(!t){if(u[0]===9&&u[1]>=3)t=2;else if(u[0]===8)t=1}return t};e.exports.get_napi_version_as_string=function(t){var r=e.exports.get_napi_version(t);return r?""+r:""};e.exports.validate_package_json=function(t,r){var a=t.binary;var o=pathOK(a.module_path);var s=pathOK(a.remote_path);var u=pathOK(a.package_name);var c=e.exports.get_napi_build_versions(t,r,true);var d=e.exports.get_napi_build_versions_raw(t);if(c){c.forEach((function(e){if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(c&&(!o||!s&&!u)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||s||u)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(c&&!e.exports.get_best_napi_build_version(t,r)&&e.exports.build_napi_only(t)){throw new Error("The N-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports N-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!c&&e.exports.build_napi_only(t)){throw new Error("The N-API version of this Node instance is "+e.exports.get_napi_version(r?r.target:undefined)+". "+"This module supports N-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,r,a){var o=[];var s=e.exports.get_napi_build_versions(t,r);a.forEach((function(a){if(s&&a.name==="install"){var u=e.exports.get_best_napi_build_version(t,r);var f=u?[d+u]:[];o.push({name:a.name,args:f})}else if(s&&c.indexOf(a.name)!==-1){s.forEach((function(e){var t=a.args.slice();t.push(d+e);o.push({name:a.name,args:t})}))}else{o.push(a)}}));return o};e.exports.get_napi_build_versions=function(t,r,a){var o=[];var u=e.exports.get_napi_version(r?r.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((function(e){var t=o.indexOf(e)!==-1;if(!t&&u&&e<=u){o.push(e)}else if(a&&!t&&u){s.info("This Node instance does not support builds for N-API version",e)}}))}if(r&&r["build-latest-napi-version-only"]){var c=0;o.forEach((function(e){if(e>c)c=e}));o=c?[c]:[]}return o.length?o:undefined};e.exports.get_napi_build_versions_raw=function(e){var t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((function(e){if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return d+e};e.exports.get_napi_build_version_from_command_args=function(e){for(var t=0;ta&&e<=s){a=e}}))}return a===0?undefined:a};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},5574:(e,t,r)=>{"use strict";e.exports=t;var a=r(1017);var o=r(7849);var s=r(7310);var u=r(2157);var c=r(9248);var d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=r(7316)}var f={};Object.keys(d).forEach((function(e){var t=e.split(".")[0];if(!f[t]){f[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}var r=o.parse(t);return e+"-v"+r.major+"."+r.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}var r=o.parse(t.node);if(r.major===0&&r.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{var r;if(d[t]){r=d[t]}else{var a=t.split(".").map((function(e){return+e}));if(a.length!=3){throw new Error("Unknown target version: "+t)}var o=a[0];var s=a[1];var u=a[2];if(o===1){while(true){if(s>0)--s;if(u>0)--u;var c=""+o+"."+s+"."+u;if(d[c]){r=d[c];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+c+" as ABI compatible target");break}if(s===0&&u===0){break}}}else if(o>=2){if(f[o]){r=d[f[o]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+f[o]+" as ABI compatible target")}}else if(o===0){if(a[1]%2===0){while(--u>0){var p=""+o+"."+s+"."+u;if(d[p]){r=d[p];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+p+" as ABI compatible target");break}}}}}if(!r){throw new Error("Unsupported target version: "+t)}var h={node:t,v8:r.v8+".0",modules:r.node_abi>1?r.node_abi:undefined};return get_node_abi(e,h)}}}e.exports.get_runtime_abi=get_runtime_abi;var p=["module_name","module_path","host"];function validate_config(e,t){var r=e.name+" package.json is not node-pre-gyp ready:\n";var a=[];if(!e.main){a.push("main")}if(!e.version){a.push("version")}if(!e.name){a.push("name")}if(!e.binary){a.push("binary")}var o=e.binary;p.forEach((function(e){if(a.indexOf("binary")>-1){a.pop("binary")}if(!o||o[e]===undefined||o[e]===""){a.push("binary."+e)}}));if(a.length>=1){throw new Error(r+"package.json must declare these properties: \n"+a.join("\n"))}if(o){var u=s.parse(o.host).protocol;if(u==="http:"){throw new Error("'host' protocol ("+u+") is invalid - only 'https:' is accepted")}}c.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((function(r){var a="{"+r+"}";while(e.indexOf(a)>-1){e=e.replace(a,t[r])}}));return e}function fix_slashes(e){if(e.slice(-1)!="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){var t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;var h="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";var v="";e.exports.evaluate=function(e,t,r){t=t||{};validate_config(e,t);var d=e.version;var f=o.parse(d);var p=t.runtime||get_process_runtime(process.versions);var _={name:e.name,configuration:Boolean(t.debug)?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:f.version,prerelease:f.prerelease.length?f.prerelease.join("."):"",build:f.build.length?f.build.join("."):"",major:f.major,minor:f.minor,patch:f.patch,runtime:p,node_abi:get_runtime_abi(p,t.target),node_abi_napi:c.get_napi_version(t.target)?"napi":get_runtime_abi(p,t.target),napi_version:c.get_napi_version(t.target),napi_build_version:r||"",node_napi_label:r?"napi-v"+r:get_runtime_abi(p,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||u.family||"unknown",module_main:e.main,toolset:t.toolset||""};var g=process.env["npm_config_"+_.module_name+"_binary_host_mirror"]||e.binary.host;_.host=fix_slashes(eval_template(g,_));_.module_path=eval_template(e.binary.module_path,_);if(t.module_root){_.module_path=a.join(t.module_root,_.module_path)}else{_.module_path=a.resolve(_.module_path)}_.module=a.join(_.module_path,_.module_name+".node");_.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,_))):v;var y=e.binary.package_name?e.binary.package_name:h;_.package_name=eval_template(y,_);_.staged_tarball=a.join("build/stage",_.remote_path,_.package_name);_.hosted_path=s.resolve(_.host,_.remote_path);_.hosted_tarball=s.resolve(_.hosted_path,_.package_name);return _}},3632:(e,t,r)=>{e.exports=rimraf;rimraf.sync=rimrafSync;var a=r(9491);var o=r(1017);var s=r(7147);var u=undefined;try{u=r(3535)}catch(e){}var c=parseInt("666",8);var d={nosort:true,silent:true};var f=0;var p=process.platform==="win32";function defaults(e){var t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((function(t){e[t]=e[t]||s[t];t=t+"Sync";e[t]=e[t]||s[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&u===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||d}function rimraf(e,t,r){if(typeof t==="function"){r=t;t={}}a(e,"rimraf: missing path");a.equal(typeof e,"string","rimraf: path should be a string");a.equal(typeof r,"function","rimraf: callback function required");a(t,"rimraf: invalid options argument provided");a.equal(typeof t,"object","rimraf: options should be object");defaults(t);var o=0;var s=null;var c=0;if(t.disableGlob||!u.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,(function(r,a){if(!r)return afterGlob(null,[e]);u(e,t.glob,afterGlob)}));function next(e){s=s||e;if(--c===0)r(s)}function afterGlob(e,a){if(e)return r(e);c=a.length;if(c===0)return r();a.forEach((function(e){rimraf_(e,t,(function CB(r){if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&o{"use strict";var a=r(2717);var o=r(6054);var s=r(2361).EventEmitter;var u=t=e.exports=new s;var c=r(3837);var d=r(8834);var f=r(6322);d(true);var p=process.stderr;Object.defineProperty(u,"stream",{set:function(e){p=e;if(this.gauge)this.gauge.setWriteTo(p,p)},get:function(){return p}});var h;u.useColor=function(){return h!=null?h:p.isTTY};u.enableColor=function(){h=true;this.gauge.setTheme({hasColor:h,hasUnicode:v})};u.disableColor=function(){h=false;this.gauge.setTheme({hasColor:h,hasUnicode:v})};u.level="info";u.gauge=new o(p,{enabled:false,theme:{hasColor:u.useColor()},template:[{type:"progressbar",length:20},{type:"activityIndicator",kerning:1,length:1},{type:"section",default:""},":",{type:"logline",kerning:1,default:""}]});u.tracker=new a.TrackerGroup;u.progressEnabled=u.gauge.isEnabled();var v;u.enableUnicode=function(){v=true;this.gauge.setTheme({hasColor:this.useColor(),hasUnicode:v})};u.disableUnicode=function(){v=false;this.gauge.setTheme({hasColor:this.useColor(),hasUnicode:v})};u.setGaugeThemeset=function(e){this.gauge.setThemeset(e)};u.setGaugeTemplate=function(e){this.gauge.setTemplate(e)};u.enableProgress=function(){if(this.progressEnabled)return;this.progressEnabled=true;this.tracker.on("change",this.showProgress);if(this._pause)return;this.gauge.enable()};u.disableProgress=function(){if(!this.progressEnabled)return;this.progressEnabled=false;this.tracker.removeListener("change",this.showProgress);this.gauge.disable()};var _=["newGroup","newItem","newStream"];var mixinLog=function(e){Object.keys(u).forEach((function(t){if(t[0]==="_")return;if(_.filter((function(e){return e===t})).length)return;if(e[t])return;if(typeof u[t]!=="function")return;var r=u[t];e[t]=function(){return r.apply(u,arguments)}}));if(e instanceof a.TrackerGroup){_.forEach((function(t){var r=e[t];e[t]=function(){return mixinLog(r.apply(e,arguments))}}))}return e};_.forEach((function(e){u[e]=function(){return mixinLog(this.tracker[e].apply(this.tracker,arguments))}}));u.clearProgress=function(e){if(!this.progressEnabled)return e&&process.nextTick(e);this.gauge.hide(e)};u.showProgress=function(e,t){if(!this.progressEnabled)return;var r={};if(e)r.section=e;var a=u.record[u.record.length-1];if(a){r.subsection=a.prefix;var o=u.disp[a.level]||a.level;var s=this._format(o,u.style[a.level]);if(a.prefix)s+=" "+this._format(a.prefix,this.prefixStyle);s+=" "+a.message.split(/\r?\n/)[0];r.logline=s}r.completed=t||this.tracker.completed();this.gauge.show(r)}.bind(u);u.pause=function(){this._paused=true;if(this.progressEnabled)this.gauge.disable()};u.resume=function(){if(!this._paused)return;this._paused=false;var e=this._buffer;this._buffer=[];e.forEach((function(e){this.emitLog(e)}),this);if(this.progressEnabled)this.gauge.enable()};u._buffer=[];var g=0;u.record=[];u.maxRecordSize=1e4;u.log=function(e,t,r){var a=this.levels[e];if(a===undefined){return this.emit("error",new Error(c.format("Undefined log level: %j",e)))}var o=new Array(arguments.length-2);var s=null;for(var u=2;up/10){var v=Math.floor(p*.9);this.record=this.record.slice(-1*v)}this.emitLog(f)}.bind(u);u.emitLog=function(e){if(this._paused){this._buffer.push(e);return}if(this.progressEnabled)this.gauge.pulse(e.prefix);var t=this.levels[e.level];if(t===undefined)return;if(t0&&!isFinite(t))return;var r=u.disp[e.level]!=null?u.disp[e.level]:e.level;this.clearProgress();e.message.split(/\r?\n/).forEach((function(t){if(this.heading){this.write(this.heading,this.headingStyle);this.write(" ")}this.write(r,u.style[e.level]);var a=e.prefix||"";if(a)this.write(" ");this.write(a,this.prefixStyle);this.write(" "+t+"\n")}),this);this.showProgress()};u._format=function(e,t){if(!p)return;var r="";if(this.useColor()){t=t||{};var a=[];if(t.fg)a.push(t.fg);if(t.bg)a.push("bg"+t.bg[0].toUpperCase()+t.bg.slice(1));if(t.bold)a.push("bold");if(t.underline)a.push("underline");if(t.inverse)a.push("inverse");if(a.length)r+=f.color(a);if(t.beep)r+=f.beep()}r+=e;if(this.useColor()){r+=f.color("reset")}return r};u.write=function(e,t){if(!p)return;p.write(this._format(e,t))};u.addLevel=function(e,t,r,a){if(a==null)a=e;this.levels[e]=t;this.style[e]=r;if(!this[e]){this[e]=function(){var t=new Array(arguments.length+1);t[0]=e;for(var r=0;r{"use strict";e.exports=Number.isNaN||function(e){return e!==e}},1800:e=>{"use strict"; /* object-assign (c) Sindre Sorhus diff --git a/packages/next/compiled/watchpack/watchpack.js b/packages/next/compiled/watchpack/watchpack.js index 233685b103e27fe..fc4f1889394f741 100644 --- a/packages/next/compiled/watchpack/watchpack.js +++ b/packages/next/compiled/watchpack/watchpack.js @@ -1 +1 @@ -(()=>{var e={140:e=>{e.exports=function(e,t){if(typeof e!=="string"){throw new TypeError("Expected a string")}var i=String(e);var s="";var r=t?!!t.extended:false;var n=t?!!t.globstar:false;var c=false;var a=t&&typeof t.flags==="string"?t.flags:"";var o;for(var h=0,f=i.length;h1&&(l==="/"||l===undefined)&&(d==="/"||d===undefined);if(p){s+="((?:[^/]*(?:/|$))*)";h++}else{s+="([^/]*)"}}break;default:s+=o}}if(!a||!~a.indexOf("g")){s="^"+s+"$"}return new RegExp(s,a)}},132:e=>{"use strict";e.exports=clone;function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var t={__proto__:e.__proto__};else var t=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}));return t}},552:(e,t,i)=>{var s=i(147);var r=i(290);var n=i(410);var c=i(132);var a=i(837);var o;var h;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){o=Symbol.for("graceful-fs.queue");h=Symbol.for("graceful-fs.previous")}else{o="___graceful-fs.queue";h="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,o,{get:function(){return t}})}var f=noop;if(a.debuglog)f=a.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))f=function(){var e=a.format.apply(a,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!s[o]){var l=global[o]||[];publishQueue(s,l);s.close=function(e){function close(t,i){return e.call(s,t,(function(e){if(!e){retry()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,h,{value:e});return close}(s.close);s.closeSync=function(e){function closeSync(t){e.apply(s,arguments);retry()}Object.defineProperty(closeSync,h,{value:e});return closeSync}(s.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){f(s[o]);i(491).equal(s[o].length,0)}))}}if(!global[o]){publishQueue(global,s[o])}e.exports=patch(c(s));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!s.__patched){e.exports=patch(s);s.__patched=true}function patch(e){r(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,i,s){if(typeof i==="function")s=i,i=null;return go$readFile(e,i,s);function go$readFile(e,i,s){return t(e,i,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,i,s]]);else{if(typeof s==="function")s.apply(this,arguments);retry()}}))}}var i=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,s,r){if(typeof s==="function")r=s,s=null;return go$writeFile(e,t,s,r);function go$writeFile(e,t,s,r){return i(e,t,s,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[e,t,s,r]]);else{if(typeof r==="function")r.apply(this,arguments);retry()}}))}}var s=e.appendFile;if(s)e.appendFile=appendFile;function appendFile(e,t,i,r){if(typeof i==="function")r=i,i=null;return go$appendFile(e,t,i,r);function go$appendFile(e,t,i,r){return s(e,t,i,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$appendFile,[e,t,i,r]]);else{if(typeof r==="function")r.apply(this,arguments);retry()}}))}}var c=e.readdir;e.readdir=readdir;function readdir(e,t,i){var s=[e];if(typeof t!=="function"){s.push(t)}else{i=t}s.push(go$readdir$cb);return go$readdir(s);function go$readdir$cb(e,t){if(t&&t.sort)t.sort();if(e&&(e.code==="EMFILE"||e.code==="ENFILE"))enqueue([go$readdir,[s]]);else{if(typeof i==="function")i.apply(this,arguments);retry()}}}function go$readdir(t){return c.apply(e,t)}if(process.version.substr(0,4)==="v0.8"){var a=n(e);ReadStream=a.ReadStream;WriteStream=a.WriteStream}var o=e.ReadStream;if(o){ReadStream.prototype=Object.create(o.prototype);ReadStream.prototype.open=ReadStream$open}var h=e.WriteStream;if(h){WriteStream.prototype=Object.create(h.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var f=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return f},set:function(e){f=e},enumerable:true,configurable:true});var l=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return l},set:function(e){l=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return o.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,i){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=i;e.emit("open",i);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return h.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,i){if(t){e.destroy();e.emit("error",t)}else{e.fd=i;e.emit("open",i)}}))}function createReadStream(t,i){return new e.ReadStream(t,i)}function createWriteStream(t,i){return new e.WriteStream(t,i)}var u=e.open;e.open=open;function open(e,t,i,s){if(typeof i==="function")s=i,i=null;return go$open(e,t,i,s);function go$open(e,t,i,s){return u(e,t,i,(function(r,n){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$open,[e,t,i,s]]);else{if(typeof s==="function")s.apply(this,arguments);retry()}}))}}return e}function enqueue(e){f("ENQUEUE",e[0].name,e[1]);s[o].push(e)}function retry(){var e=s[o].shift();if(e){f("RETRY",e[0].name,e[1]);e[0].apply(null,e[1])}}},410:(e,t,i)=>{var s=i(781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,i){if(!(this instanceof ReadStream))return new ReadStream(t,i);s.call(this);var r=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var n=Object.keys(i);for(var c=0,a=n.length;cthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){r._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){r.emit("error",e);r.readable=false;return}r.fd=t;r.emit("open",t);r._read()}))}function WriteStream(t,i){if(!(this instanceof WriteStream))return new WriteStream(t,i);s.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var r=Object.keys(i);for(var n=0,c=r.length;n= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},290:(e,t,i)=>{var s=i(57);var r=process.cwd;var n=null;var c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!n)n=r.call(process);return n};try{process.cwd()}catch(e){}var a=process.chdir;process.chdir=function(e){n=null;a.call(process,e)};e.exports=patch;function patch(e){if(s.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,i){if(i)process.nextTick(i)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,i,s){if(s)process.nextTick(s)};e.lchownSync=function(){}}if(c==="win32"){e.rename=function(t){return function(i,s,r){var n=Date.now();var c=0;t(i,s,(function CB(a){if(a&&(a.code==="EACCES"||a.code==="EPERM")&&Date.now()-n<6e4){setTimeout((function(){e.stat(s,(function(e,n){if(e&&e.code==="ENOENT")t(i,s,CB);else r(a)}))}),c);if(c<100)c+=10;return}if(r)r(a)}))}}(e.rename)}e.read=function(t){function read(i,s,r,n,c,a){var o;if(a&&typeof a==="function"){var h=0;o=function(f,l,u){if(f&&f.code==="EAGAIN"&&h<10){h++;return t.call(e,i,s,r,n,c,o)}a.apply(this,arguments)}}return t.call(e,i,s,r,n,c,o)}read.__proto__=t;return read}(e.read);e.readSync=function(t){return function(i,s,r,n,c){var a=0;while(true){try{return t.call(e,i,s,r,n,c)}catch(e){if(e.code==="EAGAIN"&&a<10){a++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,i,r){e.open(t,s.O_WRONLY|s.O_SYMLINK,i,(function(t,s){if(t){if(r)r(t);return}e.fchmod(s,i,(function(t){e.close(s,(function(e){if(r)r(t||e)}))}))}))};e.lchmodSync=function(t,i){var r=e.openSync(t,s.O_WRONLY|s.O_SYMLINK,i);var n=true;var c;try{c=e.fchmodSync(r,i);n=false}finally{if(n){try{e.closeSync(r)}catch(e){}}else{e.closeSync(r)}}return c}}function patchLutimes(e){if(s.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,i,r,n){e.open(t,s.O_SYMLINK,(function(t,s){if(t){if(n)n(t);return}e.futimes(s,i,r,(function(t){e.close(s,(function(e){if(n)n(t||e)}))}))}))};e.lutimesSync=function(t,i,r){var n=e.openSync(t,s.O_SYMLINK);var c;var a=true;try{c=e.futimesSync(n,i,r);a=false}finally{if(a){try{e.closeSync(n)}catch(e){}}else{e.closeSync(n)}}return c}}else{e.lutimes=function(e,t,i,s){if(s)process.nextTick(s)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(i,s,r){return t.call(e,i,s,(function(e){if(chownErOk(e))e=null;if(r)r.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(i,s){try{return t.call(e,i,s)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(i,s,r,n){return t.call(e,i,s,r,(function(e){if(chownErOk(e))e=null;if(n)n.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(i,s,r){try{return t.call(e,i,s,r)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(i,s,r){if(typeof s==="function"){r=s;s=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(r)r.apply(this,arguments)}return s?t.call(e,i,s,callback):t.call(e,i,callback)}}function statFixSync(t){if(!t)return t;return function(i,s){var r=s?t.call(e,i,s):t.call(e,i);if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296;return r}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},238:(e,t,i)=>{"use strict";const s=i(361).EventEmitter;const r=i(552);const n=i(17);const c=i(344);const a=Object.freeze({});let o=1e3;const h=i(37).platform()==="darwin";const f=process.env.WATCHPACK_POLLING;const l=`${+f}`===f?+f:!!f&&f!=="false";function withoutCase(e){return e.toLowerCase()}function needCalls(e,t){return function(){if(--e===0){return t()}}}class Watcher extends s{constructor(e,t,i){super();this.directoryWatcher=e;this.path=t;this.startTime=i&&+i}checkStartTime(e,t){const i=this.startTime;if(typeof i!=="number")return!t;return i<=e}close(){this.emit("closed")}}class DirectoryWatcher extends s{constructor(e,t,i){super();if(l){i.poll=l}this.watcherManager=e;this.options=i;this.path=t;this.files=new Map;this.filesWithoutCase=new Map;this.directories=new Map;this.lastWatchEvent=0;this.initialScan=true;this.ignored=i.ignored||(()=>false);this.nestedWatching=false;this.polledWatching=typeof i.poll==="number"?i.poll:i.poll?5007:false;this.timeout=undefined;this.initialScanRemoved=new Set;this.initialScanFinished=undefined;this.watchers=new Map;this.parentWatcher=null;this.refs=0;this._activeEvents=new Map;this.closed=false;this.scanning=false;this.scanAgain=false;this.scanAgainInitial=false;this.createWatcher();this.doScan(true)}createWatcher(){try{if(this.polledWatching){this.watcher={close:()=>{if(this.timeout){clearTimeout(this.timeout);this.timeout=undefined}}}}else{if(h){this.watchInParentDirectory()}this.watcher=c.watch(this.path);this.watcher.on("change",this.onWatchEvent.bind(this));this.watcher.on("error",this.onWatcherError.bind(this))}}catch(e){this.onWatcherError(e)}}forEachWatcher(e,t){const i=this.watchers.get(withoutCase(e));if(i!==undefined){for(const e of i){t(e)}}}setMissing(e,t,i){if(this.initialScan){this.initialScanRemoved.add(e)}const s=this.directories.get(e);if(s){if(this.nestedWatching)s.close();this.directories.delete(e);this.forEachWatcher(e,(e=>e.emit("remove",i)));if(!t){this.forEachWatcher(this.path,(s=>s.emit("change",e,null,i,t)))}}const r=this.files.get(e);if(r){this.files.delete(e);const s=withoutCase(e);const r=this.filesWithoutCase.get(s)-1;if(r<=0){this.filesWithoutCase.delete(s);this.forEachWatcher(e,(e=>e.emit("remove",i)))}else{this.filesWithoutCase.set(s,r)}if(!t){this.forEachWatcher(this.path,(s=>s.emit("change",e,null,i,t)))}}}setFileTime(e,t,i,s,r){const n=Date.now();if(this.ignored(e))return;const c=this.files.get(e);let a,h;if(i){a=Math.min(n,t)+o;h=o}else{a=n;h=0;if(c&&c.timestamp===t&&t+o{if(!i||e.checkStartTime(a,i)){e.emit("change",t,r)}}))}else if(!i){this.forEachWatcher(e,(e=>e.emit("change",t,r)))}this.forEachWatcher(this.path,(t=>{if(!i||t.checkStartTime(a,i)){t.emit("change",e,a,r,i)}}))}setDirectory(e,t,i,s){if(this.ignored(e))return;if(e===this.path){if(!i){this.forEachWatcher(this.path,(r=>r.emit("change",e,t,s,i)))}}else{const r=this.directories.get(e);if(!r){const r=Date.now();if(this.nestedWatching){this.createNestedWatcher(e)}else{this.directories.set(e,true)}let n;if(i){n=Math.min(r,t)+o}else{n=r}this.forEachWatcher(e,(e=>{if(!i||e.checkStartTime(n,false)){e.emit("change",t,s)}}));this.forEachWatcher(this.path,(t=>{if(!i||t.checkStartTime(n,i)){t.emit("change",e,n,s,i)}}))}}}createNestedWatcher(e){const t=this.watcherManager.watchDirectory(e,1);t.on("change",((e,t,i,s)=>{this.forEachWatcher(this.path,(r=>{if(!s||r.checkStartTime(t,s)){r.emit("change",e,t,i,s)}}))}));this.directories.set(e,t)}setNestedWatching(e){if(this.nestedWatching!==!!e){this.nestedWatching=!!e;if(this.nestedWatching){for(const e of this.directories.keys()){this.createNestedWatcher(e)}}else{for(const[e,t]of this.directories){t.close();this.directories.set(e,true)}}}}watch(e,t){const i=withoutCase(e);let s=this.watchers.get(i);if(s===undefined){s=new Set;this.watchers.set(i,s)}this.refs++;const r=new Watcher(this,e,t);r.on("closed",(()=>{if(--this.refs<=0){this.close();return}s.delete(r);if(s.size===0){this.watchers.delete(i);if(this.path===e)this.setNestedWatching(false)}}));s.add(r);let n;if(e===this.path){this.setNestedWatching(true);n=this.lastWatchEvent;for(const e of this.files.values()){fixupEntryAccuracy(e);n=Math.max(n,e.safeTime)}}else{const t=this.files.get(e);if(t){fixupEntryAccuracy(t);n=t.safeTime}else{n=0}}if(n){if(n>=t){process.nextTick((()=>{if(this.closed)return;if(e===this.path){r.emit("change",e,n,"watch (outdated on attach)",true)}else{r.emit("change",n,"watch (outdated on attach)",true)}}))}}else if(this.initialScan){if(this.initialScanRemoved.has(e)){process.nextTick((()=>{if(this.closed)return;r.emit("remove")}))}}else if(!this.directories.has(e)&&r.checkStartTime(this.initialScanFinished,false)){process.nextTick((()=>{if(this.closed)return;r.emit("initial-missing","watch (missing on attach)")}))}return r}onWatchEvent(e,t){if(this.closed)return;if(!t){this.doScan(false);return}const i=n.join(this.path,t);if(this.ignored(i))return;if(this._activeEvents.get(t)===undefined){this._activeEvents.set(t,false);const checkStats=()=>{if(this.closed)return;this._activeEvents.set(t,false);r.lstat(i,((s,c)=>{if(this.closed)return;if(this._activeEvents.get(t)===true){process.nextTick(checkStats);return}this._activeEvents.delete(t);if(s){if(s.code!=="ENOENT"&&s.code!=="EPERM"&&s.code!=="EBUSY"){this.onStatsError(s)}else{if(t===n.basename(this.path)){if(!r.existsSync(this.path)){this.onDirectoryRemoved("stat failed")}}}}this.lastWatchEvent=Date.now();if(!c){this.setMissing(i,false,e)}else if(c.isDirectory()){this.setDirectory(i,+c.birthtime||1,false,e)}else if(c.isFile()||c.isSymbolicLink()){if(c.mtime){ensureFsAccuracy(c.mtime)}this.setFileTime(i,+c.mtime||+c.ctime||1,false,false,e)}}))};process.nextTick(checkStats)}else{this._activeEvents.set(t,true)}}onWatcherError(e){if(this.closed)return;if(e){if(e.code!=="EPERM"&&e.code!=="ENOENT"){console.error("Watchpack Error (watcher): "+e)}this.onDirectoryRemoved("watch error")}}onStatsError(e){if(e){console.error("Watchpack Error (stats): "+e)}}onScanError(e){if(e){console.error("Watchpack Error (initial scan): "+e)}this.onScanFinished()}onScanFinished(){if(this.polledWatching){this.timeout=setTimeout((()=>{if(this.closed)return;this.doScan(false)}),this.polledWatching)}}onDirectoryRemoved(e){if(this.watcher){this.watcher.close();this.watcher=null}this.watchInParentDirectory();const t=`directory-removed (${e})`;for(const e of this.directories.keys()){this.setMissing(e,null,t)}for(const e of this.files.keys()){this.setMissing(e,null,t)}}watchInParentDirectory(){if(!this.parentWatcher){const e=n.dirname(this.path);if(n.dirname(e)===e)return;this.parentWatcher=this.watcherManager.watchFile(this.path,1);this.parentWatcher.on("change",((e,t)=>{if(this.closed)return;if((!h||this.polledWatching)&&this.parentWatcher){this.parentWatcher.close();this.parentWatcher=null}if(!this.watcher){this.createWatcher();this.doScan(false);this.forEachWatcher(this.path,(i=>i.emit("change",this.path,e,t,false)))}}));this.parentWatcher.on("remove",(()=>{this.onDirectoryRemoved("parent directory removed")}))}}doScan(e){if(this.scanning){if(this.scanAgain){if(!e)this.scanAgainInitial=false}else{this.scanAgain=true;this.scanAgainInitial=e}return}this.scanning=true;if(this.timeout){clearTimeout(this.timeout);this.timeout=undefined}process.nextTick((()=>{if(this.closed)return;r.readdir(this.path,((t,i)=>{if(this.closed)return;if(t){if(t.code==="ENOENT"||t.code==="EPERM"){this.onDirectoryRemoved("scan readdir failed")}else{this.onScanError(t)}this.initialScan=false;this.initialScanFinished=Date.now();if(e){for(const e of this.watchers.values()){for(const t of e){if(t.checkStartTime(this.initialScanFinished,false)){t.emit("initial-missing","scan (parent directory missing in initial scan)")}}}}if(this.scanAgain){this.scanAgain=false;this.doScan(this.scanAgainInitial)}else{this.scanning=false}return}const s=new Set(i.map((e=>n.join(this.path,e.normalize("NFC")))));for(const t of this.files.keys()){if(!s.has(t)){this.setMissing(t,e,"scan (missing)")}}for(const t of this.directories.keys()){if(!s.has(t)){this.setMissing(t,e,"scan (missing)")}}if(this.scanAgain){this.scanAgain=false;this.doScan(e);return}const c=needCalls(s.size+1,(()=>{if(this.closed)return;this.initialScan=false;this.initialScanRemoved=null;this.initialScanFinished=Date.now();if(e){const e=new Map(this.watchers);e.delete(withoutCase(this.path));for(const t of s){e.delete(withoutCase(t))}for(const t of e.values()){for(const e of t){if(e.checkStartTime(this.initialScanFinished,false)){e.emit("initial-missing","scan (missing in initial scan)")}}}}if(this.scanAgain){this.scanAgain=false;this.doScan(this.scanAgainInitial)}else{this.scanning=false;this.onScanFinished()}}));for(const t of s){r.lstat(t,((i,s)=>{if(this.closed)return;if(i){if(i.code==="ENOENT"||i.code==="EPERM"||i.code==="EACCES"||i.code==="EBUSY"){this.setMissing(t,e,"scan ("+i.code+")")}else{this.onScanError(i)}c();return}if(s.isFile()||s.isSymbolicLink()){if(s.mtime){ensureFsAccuracy(s.mtime)}this.setFileTime(t,+s.mtime||+s.ctime||1,e,true,"scan (file)")}else if(s.isDirectory()){if(!e||!this.directories.has(t))this.setDirectory(t,+s.birthtime||1,e,"scan (dir)")}c()}))}c()}))}))}getTimes(){const e=Object.create(null);let t=this.lastWatchEvent;for(const[i,s]of this.files){fixupEntryAccuracy(s);t=Math.max(t,s.safeTime);e[i]=Math.max(s.safeTime,s.timestamp)}if(this.nestedWatching){for(const i of this.directories.values()){const s=i.directoryWatcher.getTimes();for(const i of Object.keys(s)){const r=s[i];t=Math.max(t,r);e[i]=r}}e[this.path]=t}if(!this.initialScan){for(const t of this.watchers.values()){for(const i of t){const t=i.path;if(!Object.prototype.hasOwnProperty.call(e,t)){e[t]=null}}}}return e}collectTimeInfoEntries(e,t){let i=this.lastWatchEvent;for(const[t,s]of this.files){fixupEntryAccuracy(s);i=Math.max(i,s.safeTime);e.set(t,s)}if(this.nestedWatching){for(const s of this.directories.values()){i=Math.max(i,s.directoryWatcher.collectTimeInfoEntries(e,t))}e.set(this.path,a);t.set(this.path,{safeTime:i})}else{for(const i of this.directories.keys()){e.set(i,a);if(!t.has(i))t.set(i,a)}e.set(this.path,a);t.set(this.path,a)}if(!this.initialScan){for(const t of this.watchers.values()){for(const i of t){const t=i.path;if(!e.has(t)){e.set(t,null)}}}}return i}close(){this.closed=true;this.initialScan=false;if(this.watcher){this.watcher.close();this.watcher=null}if(this.nestedWatching){for(const e of this.directories.values()){e.close()}this.directories.clear()}if(this.parentWatcher){this.parentWatcher.close();this.parentWatcher=null}this.emit("closed")}}e.exports=DirectoryWatcher;e.exports.EXISTANCE_ONLY_TIME_ENTRY=a;function fixupEntryAccuracy(e){if(e.accuracy>o){e.safeTime=e.safeTime-e.accuracy+o;e.accuracy=o}}function ensureFsAccuracy(e){if(!e)return;if(o>1&&e%1!==0)o=1;else if(o>10&&e%10!==0)o=10;else if(o>100&&e%100!==0)o=100}},669:(e,t,i)=>{"use strict";const s=i(147);const r=i(17);const n=new Set(["EINVAL","ENOENT"]);if(process.platform==="win32")n.add("UNKNOWN");class LinkResolver{constructor(){this.cache=new Map}resolve(e){const t=this.cache.get(e);if(t!==undefined){return t}const i=r.dirname(e);if(i===e){const t=Object.freeze([e]);this.cache.set(e,t);return t}const c=this.resolve(i);let a=e;if(c[0]!==i){const t=r.basename(e);a=r.resolve(c[0],t)}try{const t=s.readlinkSync(a);const i=r.resolve(c[0],t);const n=this.resolve(i);let o;if(n.length>1&&c.length>1){const e=new Set(n);e.add(a);for(let t=1;t1){o=c.slice();o[0]=n[0];o.push(a);Object.freeze(o)}else if(n.length>1){o=n.slice();o.push(a);Object.freeze(o)}else{o=Object.freeze([n[0],a])}this.cache.set(e,o);return o}catch(t){if(!n.has(t.code)){throw t}const i=c.slice();i[0]=a;Object.freeze(i);this.cache.set(e,i);return i}}}e.exports=LinkResolver},399:(e,t,i)=>{"use strict";const s=i(17);const r=i(238);class WatcherManager{constructor(e){this.options=e;this.directoryWatchers=new Map}getDirectoryWatcher(e){const t=this.directoryWatchers.get(e);if(t===undefined){const t=new r(this,e,this.options);this.directoryWatchers.set(e,t);t.on("closed",(()=>{this.directoryWatchers.delete(e)}));return t}return t}watchFile(e,t){const i=s.dirname(e);if(i===e)return null;return this.getDirectoryWatcher(i).watch(e,t)}watchDirectory(e,t){return this.getDirectoryWatcher(e).watch(e,t)}}const n=new WeakMap;e.exports=e=>{const t=n.get(e);if(t!==undefined)return t;const i=new WatcherManager(e);n.set(e,i);return i};e.exports.WatcherManager=WatcherManager},385:(e,t,i)=>{"use strict";const s=i(17);e.exports=(e,t)=>{const i=new Map;for(const[t,s]of e){i.set(t,{filePath:t,parent:undefined,children:undefined,entries:1,active:true,value:s})}let r=i.size;for(const e of i.values()){const t=s.dirname(e.filePath);if(t!==e.filePath){let s=i.get(t);if(s===undefined){s={filePath:t,parent:undefined,children:[e],entries:e.entries,active:false,value:undefined};i.set(t,s);e.parent=s}else{e.parent=s;if(s.children===undefined){s.children=[e]}else{s.children.push(e)}do{s.entries+=e.entries;s=s.parent}while(s)}}}while(r>t){const e=r-t;let s=undefined;let n=Infinity;for(const r of i.values()){if(r.entries<=1||!r.children||!r.parent)continue;if(r.children.length===0)continue;if(r.children.length===1&&!r.value)continue;const i=r.entries-1>=e?r.entries-1-e:e-r.entries+1+t*.3;if(i{"use strict";const s=i(147);const r=i(17);const{EventEmitter:n}=i(361);const c=i(385);const a=i(37).platform()==="darwin";const o=i(37).platform()==="win32";const h=a||o;const f=+process.env.WATCHPACK_WATCHER_LIMIT||(a?2e3:1e4);const l=!!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING;let u=false;let d=0;const p=new Map;const m=new Map;const g=new Map;const y=new Map;class DirectWatcher{constructor(e){this.filePath=e;this.watchers=new Set;this.watcher=undefined;try{const t=s.watch(e);this.watcher=t;t.on("change",((e,t)=>{for(const i of this.watchers){i.emit("change",e,t)}}));t.on("error",(e=>{for(const t of this.watchers){t.emit("error",e)}}))}catch(e){process.nextTick((()=>{for(const t of this.watchers){t.emit("error",e)}}))}d++}add(e){y.set(e,this);this.watchers.add(e)}remove(e){this.watchers.delete(e);if(this.watchers.size===0){g.delete(this.filePath);d--;if(this.watcher)this.watcher.close()}}getWatchers(){return this.watchers}}class RecursiveWatcher{constructor(e){this.rootPath=e;this.mapWatcherToPath=new Map;this.mapPathToWatchers=new Map;this.watcher=undefined;try{const t=s.watch(e,{recursive:true});this.watcher=t;t.on("change",((e,t)=>{if(!t){if(l){process.stderr.write(`[watchpack] dispatch ${e} event in recursive watcher (${this.rootPath}) to all watchers\n`)}for(const t of this.mapWatcherToPath.keys()){t.emit("change",e)}}else{const i=r.dirname(t);const s=this.mapPathToWatchers.get(i);if(l){process.stderr.write(`[watchpack] dispatch ${e} event in recursive watcher (${this.rootPath}) for '${t}' to ${s?s.size:0} watchers\n`)}if(s===undefined)return;for(const i of s){i.emit("change",e,r.basename(t))}}}));t.on("error",(e=>{for(const t of this.mapWatcherToPath.keys()){t.emit("error",e)}}))}catch(e){process.nextTick((()=>{for(const t of this.mapWatcherToPath.keys()){t.emit("error",e)}}))}d++;if(l){process.stderr.write(`[watchpack] created recursive watcher at ${e}\n`)}}add(e,t){y.set(t,this);const i=e.slice(this.rootPath.length+1)||".";this.mapWatcherToPath.set(t,i);const s=this.mapPathToWatchers.get(i);if(s===undefined){const e=new Set;e.add(t);this.mapPathToWatchers.set(i,e)}else{s.add(t)}}remove(e){const t=this.mapWatcherToPath.get(e);if(!t)return;this.mapWatcherToPath.delete(e);const i=this.mapPathToWatchers.get(t);i.delete(e);if(i.size===0){this.mapPathToWatchers.delete(t)}if(this.mapWatcherToPath.size===0){m.delete(this.rootPath);d--;if(this.watcher)this.watcher.close();if(l){process.stderr.write(`[watchpack] closed recursive watcher at ${this.rootPath}\n`)}}}getWatchers(){return this.mapWatcherToPath}}class Watcher extends n{close(){if(p.has(this)){p.delete(this);return}const e=y.get(this);e.remove(this);y.delete(this)}}const createDirectWatcher=e=>{const t=g.get(e);if(t!==undefined)return t;const i=new DirectWatcher(e);g.set(e,i);return i};const createRecursiveWatcher=e=>{const t=m.get(e);if(t!==undefined)return t;const i=new RecursiveWatcher(e);m.set(e,i);return i};const execute=()=>{const e=new Map;const addWatcher=(t,i)=>{const s=e.get(i);if(s===undefined){e.set(i,t)}else if(Array.isArray(s)){s.push(t)}else{e.set(i,[s,t])}};for(const[e,t]of p){addWatcher(e,t)}p.clear();if(!h||f-d>=e.size){for(const[t,i]of e){const e=createDirectWatcher(t);if(Array.isArray(i)){for(const t of i)e.add(t)}else{e.add(i)}}return}for(const e of m.values()){for(const[t,i]of e.getWatchers()){addWatcher(t,r.join(e.rootPath,i))}}for(const e of g.values()){for(const t of e.getWatchers()){addWatcher(t,e.filePath)}}const t=c(e,f*.9);for(const[e,i]of t){if(i.size===1){for(const[e,t]of i){const i=createDirectWatcher(t);const s=y.get(e);if(s===i)continue;i.add(e);if(s!==undefined)s.remove(e)}}else{const t=new Set(i.values());if(t.size>1){const t=createRecursiveWatcher(e);for(const[e,s]of i){const i=y.get(e);if(i===t)continue;t.add(s,e);if(i!==undefined)i.remove(e)}}else{for(const e of t){const t=createDirectWatcher(e);for(const e of i.keys()){const i=y.get(e);if(i===t)continue;t.add(e);if(i!==undefined)i.remove(e)}}}}}};t.watch=e=>{const t=new Watcher;const i=g.get(e);if(i!==undefined){i.add(t);return t}let s=e;for(;;){const i=m.get(s);if(i!==undefined){i.add(e,t);return t}const n=r.dirname(s);if(n===s)break;s=n}p.set(t,e);if(!u)execute();return t};t.batch=e=>{u=true;try{e()}finally{u=false;execute()}};t.getNumberOfWatchers=()=>d},375:(e,t,i)=>{"use strict";const s=i(399);const r=i(669);const n=i(361).EventEmitter;const c=i(140);const a=i(344);const o=[];const h={};function addWatchersToSet(e,t){for(const i of e){const e=i.watcher;if(!t.has(e.directoryWatcher)){t.add(e.directoryWatcher)}}}const stringToRegexp=e=>{const t=c(e,{globstar:true,extended:true}).source;const i=t.slice(0,t.length-1)+"(?:$|\\/)";return i};const ignoredToFunction=e=>{if(Array.isArray(e)){const t=new RegExp(e.map((e=>stringToRegexp(e))).join("|"));return e=>t.test(e.replace(/\\/g,"/"))}else if(typeof e==="string"){const t=new RegExp(stringToRegexp(e));return e=>t.test(e.replace(/\\/g,"/"))}else if(e instanceof RegExp){return t=>e.test(t.replace(/\\/g,"/"))}else if(e instanceof Function){return e}else if(e){throw new Error(`Invalid option for 'ignored': ${e}`)}else{return()=>false}};const normalizeOptions=e=>({followSymlinks:!!e.followSymlinks,ignored:ignoredToFunction(e.ignored),poll:e.poll});const f=new WeakMap;const cachedNormalizeOptions=e=>{const t=f.get(e);if(t!==undefined)return t;const i=normalizeOptions(e);f.set(e,i);return i};class WatchpackFileWatcher{constructor(e,t,i){this.files=Array.isArray(i)?i:[i];this.watcher=t;t.on("initial-missing",(t=>{for(const i of this.files){if(!e._missing.has(i))e._onRemove(i,i,t)}}));t.on("change",((t,i)=>{for(const s of this.files){e._onChange(s,t,s,i)}}));t.on("remove",(t=>{for(const i of this.files){e._onRemove(i,i,t)}}))}update(e){if(!Array.isArray(e)){if(this.files.length!==1){this.files=[e]}else if(this.files[0]!==e){this.files[0]=e}}else{this.files=e}}close(){this.watcher.close()}}class WatchpackDirectoryWatcher{constructor(e,t,i){this.directories=Array.isArray(i)?i:[i];this.watcher=t;t.on("initial-missing",(t=>{for(const i of this.directories){e._onRemove(i,i,t)}}));t.on("change",((t,i,s)=>{for(const r of this.directories){e._onChange(r,i,t,s)}}));t.on("remove",(t=>{for(const i of this.directories){e._onRemove(i,i,t)}}))}update(e){if(!Array.isArray(e)){if(this.directories.length!==1){this.directories=[e]}else if(this.directories[0]!==e){this.directories[0]=e}}else{this.directories=e}}close(){this.watcher.close()}}class Watchpack extends n{constructor(e){super();if(!e)e=h;this.options=e;this.aggregateTimeout=typeof e.aggregateTimeout==="number"?e.aggregateTimeout:200;this.watcherOptions=cachedNormalizeOptions(e);this.watcherManager=s(this.watcherOptions);this.fileWatchers=new Map;this.directoryWatchers=new Map;this._missing=new Set;this.startTime=undefined;this.paused=false;this.aggregatedChanges=new Set;this.aggregatedRemovals=new Set;this.aggregateTimer=undefined;this._onTimeout=this._onTimeout.bind(this)}watch(e,t,i){let s,n,c,h;if(!t){({files:s=o,directories:n=o,missing:c=o,startTime:h}=e)}else{s=e;n=t;c=o;h=i}this.paused=false;const f=this.fileWatchers;const l=this.directoryWatchers;const u=this.watcherOptions.ignored;const filter=e=>!u(e);const addToMap=(e,t,i)=>{const s=e.get(t);if(s===undefined){e.set(t,i)}else if(Array.isArray(s)){s.push(i)}else{e.set(t,[s,i])}};const d=new Map;const p=new Map;const m=new Set;if(this.watcherOptions.followSymlinks){const e=new r;for(const t of s){if(filter(t)){for(const i of e.resolve(t)){if(t===i||filter(i)){addToMap(d,i,t)}}}}for(const t of c){if(filter(t)){for(const i of e.resolve(t)){if(t===i||filter(i)){m.add(t);addToMap(d,i,t)}}}}for(const t of n){if(filter(t)){let i=true;for(const s of e.resolve(t)){if(filter(s)){addToMap(i?p:d,s,t)}i=false}}}}else{for(const e of s){if(filter(e)){addToMap(d,e,e)}}for(const e of c){if(filter(e)){m.add(e);addToMap(d,e,e)}}for(const e of n){if(filter(e)){addToMap(p,e,e)}}}for(const[e,t]of f){const i=d.get(e);if(i===undefined){t.close();f.delete(e)}else{t.update(i);d.delete(e)}}for(const[e,t]of l){const i=p.get(e);if(i===undefined){t.close();l.delete(e)}else{t.update(i);p.delete(e)}}a.batch((()=>{for(const[e,t]of d){const i=this.watcherManager.watchFile(e,h);if(i){f.set(e,new WatchpackFileWatcher(this,i,t))}}for(const[e,t]of p){const i=this.watcherManager.watchDirectory(e,h);if(i){l.set(e,new WatchpackDirectoryWatcher(this,i,t))}}}));this._missing=m;this.startTime=h}close(){this.paused=true;if(this.aggregateTimer)clearTimeout(this.aggregateTimer);for(const e of this.fileWatchers.values())e.close();for(const e of this.directoryWatchers.values())e.close();this.fileWatchers.clear();this.directoryWatchers.clear()}pause(){this.paused=true;if(this.aggregateTimer)clearTimeout(this.aggregateTimer)}getTimes(){const e=new Set;addWatchersToSet(this.fileWatchers.values(),e);addWatchersToSet(this.directoryWatchers.values(),e);const t=Object.create(null);for(const i of e){const e=i.getTimes();for(const i of Object.keys(e))t[i]=e[i]}return t}getTimeInfoEntries(){const e=new Map;this.collectTimeInfoEntries(e,e);return e}collectTimeInfoEntries(e,t){const i=new Set;addWatchersToSet(this.fileWatchers.values(),i);addWatchersToSet(this.directoryWatchers.values(),i);const s={value:0};for(const r of i){r.collectTimeInfoEntries(e,t,s)}}getAggregated(){if(this.aggregateTimer){clearTimeout(this.aggregateTimer);this.aggregateTimer=undefined}const e=this.aggregatedChanges;const t=this.aggregatedRemovals;this.aggregatedChanges=new Set;this.aggregatedRemovals=new Set;return{changes:e,removals:t}}_onChange(e,t,i,s){i=i||e;if(!this.paused){this.emit("change",i,t,s);if(this.aggregateTimer)clearTimeout(this.aggregateTimer);this.aggregateTimer=setTimeout(this._onTimeout,this.aggregateTimeout)}this.aggregatedRemovals.delete(e);this.aggregatedChanges.add(e)}_onRemove(e,t,i){t=t||e;if(!this.paused){this.emit("remove",t,i);if(this.aggregateTimer)clearTimeout(this.aggregateTimer);this.aggregateTimer=setTimeout(this._onTimeout,this.aggregateTimeout)}this.aggregatedChanges.delete(e);this.aggregatedRemovals.add(e)}_onTimeout(){this.aggregateTimer=undefined;const e=this.aggregatedChanges;const t=this.aggregatedRemovals;this.aggregatedChanges=new Set;this.aggregatedRemovals=new Set;this.emit("aggregated",e,t)}}e.exports=Watchpack},491:e=>{"use strict";e.exports=require("assert")},57:e=>{"use strict";e.exports=require("constants")},361:e=>{"use strict";e.exports=require("events")},147:e=>{"use strict";e.exports=require("fs")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},781:e=>{"use strict";e.exports=require("stream")},837:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(i){var s=t[i];if(s!==undefined){return s.exports}var r=t[i]={exports:{}};var n=true;try{e[i](r,r.exports,__nccwpck_require__);n=false}finally{if(n)delete t[i]}return r.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(375);module.exports=i})(); \ No newline at end of file +(()=>{var e={140:e=>{e.exports=function(e,t){if(typeof e!=="string"){throw new TypeError("Expected a string")}var i=String(e);var s="";var r=t?!!t.extended:false;var n=t?!!t.globstar:false;var c=false;var a=t&&typeof t.flags==="string"?t.flags:"";var o;for(var h=0,f=i.length;h1&&(l==="/"||l===undefined)&&(d==="/"||d===undefined);if(p){s+="((?:[^/]*(?:/|$))*)";h++}else{s+="([^/]*)"}}break;default:s+=o}}if(!a||!~a.indexOf("g")){s="^"+s+"$"}return new RegExp(s,a)}},132:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var i={__proto__:t(e)};else var i=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(e,t))}));return i}},552:(e,t,i)=>{var s=i(147);var r=i(290);var n=i(410);var c=i(132);var a=i(837);var o;var h;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){o=Symbol.for("graceful-fs.queue");h=Symbol.for("graceful-fs.previous")}else{o="___graceful-fs.queue";h="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,o,{get:function(){return t}})}var f=noop;if(a.debuglog)f=a.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))f=function(){var e=a.format.apply(a,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!s[o]){var l=global[o]||[];publishQueue(s,l);s.close=function(e){function close(t,i){return e.call(s,t,(function(e){if(!e){resetQueue()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,h,{value:e});return close}(s.close);s.closeSync=function(e){function closeSync(t){e.apply(s,arguments);resetQueue()}Object.defineProperty(closeSync,h,{value:e});return closeSync}(s.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){f(s[o]);i(491).equal(s[o].length,0)}))}}if(!global[o]){publishQueue(global,s[o])}e.exports=patch(c(s));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!s.__patched){e.exports=patch(s);s.__patched=true}function patch(e){r(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,i,s){if(typeof i==="function")s=i,i=null;return go$readFile(e,i,s);function go$readFile(e,i,s,r){return t(e,i,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,i,s],t,r||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var i=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,s,r){if(typeof s==="function")r=s,s=null;return go$writeFile(e,t,s,r);function go$writeFile(e,t,s,r,n){return i(e,t,s,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[e,t,s,r],i,n||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}var s=e.appendFile;if(s)e.appendFile=appendFile;function appendFile(e,t,i,r){if(typeof i==="function")r=i,i=null;return go$appendFile(e,t,i,r);function go$appendFile(e,t,i,r,n){return s(e,t,i,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$appendFile,[e,t,i,r],s,n||Date.now(),Date.now()]);else{if(typeof r==="function")r.apply(this,arguments)}}))}}var c=e.copyFile;if(c)e.copyFile=copyFile;function copyFile(e,t,i,s){if(typeof i==="function"){s=i;i=0}return go$copyFile(e,t,i,s);function go$copyFile(e,t,i,s,r){return c(e,t,i,(function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$copyFile,[e,t,i,s],n,r||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var a=e.readdir;e.readdir=readdir;function readdir(e,t,i){if(typeof t==="function")i=t,t=null;return go$readdir(e,t,i);function go$readdir(e,t,i,s){return a(e,t,(function(r,n){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$readdir,[e,t,i],r,s||Date.now(),Date.now()]);else{if(n&&n.sort)n.sort();if(typeof i==="function")i.call(this,r,n)}}))}}if(process.version.substr(0,4)==="v0.8"){var o=n(e);ReadStream=o.ReadStream;WriteStream=o.WriteStream}var h=e.ReadStream;if(h){ReadStream.prototype=Object.create(h.prototype);ReadStream.prototype.open=ReadStream$open}var f=e.WriteStream;if(f){WriteStream.prototype=Object.create(f.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var l=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:true,configurable:true});var u=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return u},set:function(e){u=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return h.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,i){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=i;e.emit("open",i);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return f.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,i){if(t){e.destroy();e.emit("error",t)}else{e.fd=i;e.emit("open",i)}}))}function createReadStream(t,i){return new e.ReadStream(t,i)}function createWriteStream(t,i){return new e.WriteStream(t,i)}var d=e.open;e.open=open;function open(e,t,i,s){if(typeof i==="function")s=i,i=null;return go$open(e,t,i,s);function go$open(e,t,i,s,r){return d(e,t,i,(function(n,c){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$open,[e,t,i,s],n,r||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}return e}function enqueue(e){f("ENQUEUE",e[0].name,e[1]);s[o].push(e);retry()}var u;function resetQueue(){var e=Date.now();for(var t=0;t2){s[o][t][3]=e;s[o][t][4]=e}}retry()}function retry(){clearTimeout(u);u=undefined;if(s[o].length===0)return;var e=s[o].shift();var t=e[0];var i=e[1];var r=e[2];var n=e[3];var c=e[4];if(n===undefined){f("RETRY",t.name,i);t.apply(null,i)}else if(Date.now()-n>=6e4){f("TIMEOUT",t.name,i);var a=i.pop();if(typeof a==="function")a.call(null,r)}else{var h=Date.now()-c;var l=Math.max(c-n,1);var d=Math.min(l*1.2,100);if(h>=d){f("RETRY",t.name,i);t.apply(null,i.concat([n]))}else{s[o].push(e)}}if(u===undefined){u=setTimeout(retry,0)}}},410:(e,t,i)=>{var s=i(781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,i){if(!(this instanceof ReadStream))return new ReadStream(t,i);s.call(this);var r=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var n=Object.keys(i);for(var c=0,a=n.length;cthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){r._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){r.emit("error",e);r.readable=false;return}r.fd=t;r.emit("open",t);r._read()}))}function WriteStream(t,i){if(!(this instanceof WriteStream))return new WriteStream(t,i);s.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var r=Object.keys(i);for(var n=0,c=r.length;n= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},290:(e,t,i)=>{var s=i(57);var r=process.cwd;var n=null;var c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!n)n=r.call(process);return n};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var a=process.chdir;process.chdir=function(e){n=null;a.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,a)}e.exports=patch;function patch(e){if(s.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,i){if(i)process.nextTick(i)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,i,s){if(s)process.nextTick(s)};e.lchownSync=function(){}}if(c==="win32"){e.rename=function(t){return function(i,s,r){var n=Date.now();var c=0;t(i,s,(function CB(a){if(a&&(a.code==="EACCES"||a.code==="EPERM")&&Date.now()-n<6e4){setTimeout((function(){e.stat(s,(function(e,n){if(e&&e.code==="ENOENT")t(i,s,CB);else r(a)}))}),c);if(c<100)c+=10;return}if(r)r(a)}))}}(e.rename)}e.read=function(t){function read(i,s,r,n,c,a){var o;if(a&&typeof a==="function"){var h=0;o=function(f,l,u){if(f&&f.code==="EAGAIN"&&h<10){h++;return t.call(e,i,s,r,n,c,o)}a.apply(this,arguments)}}return t.call(e,i,s,r,n,c,o)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=function(t){return function(i,s,r,n,c){var a=0;while(true){try{return t.call(e,i,s,r,n,c)}catch(e){if(e.code==="EAGAIN"&&a<10){a++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,i,r){e.open(t,s.O_WRONLY|s.O_SYMLINK,i,(function(t,s){if(t){if(r)r(t);return}e.fchmod(s,i,(function(t){e.close(s,(function(e){if(r)r(t||e)}))}))}))};e.lchmodSync=function(t,i){var r=e.openSync(t,s.O_WRONLY|s.O_SYMLINK,i);var n=true;var c;try{c=e.fchmodSync(r,i);n=false}finally{if(n){try{e.closeSync(r)}catch(e){}}else{e.closeSync(r)}}return c}}function patchLutimes(e){if(s.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,i,r,n){e.open(t,s.O_SYMLINK,(function(t,s){if(t){if(n)n(t);return}e.futimes(s,i,r,(function(t){e.close(s,(function(e){if(n)n(t||e)}))}))}))};e.lutimesSync=function(t,i,r){var n=e.openSync(t,s.O_SYMLINK);var c;var a=true;try{c=e.futimesSync(n,i,r);a=false}finally{if(a){try{e.closeSync(n)}catch(e){}}else{e.closeSync(n)}}return c}}else{e.lutimes=function(e,t,i,s){if(s)process.nextTick(s)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(i,s,r){return t.call(e,i,s,(function(e){if(chownErOk(e))e=null;if(r)r.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(i,s){try{return t.call(e,i,s)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(i,s,r,n){return t.call(e,i,s,r,(function(e){if(chownErOk(e))e=null;if(n)n.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(i,s,r){try{return t.call(e,i,s,r)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(i,s,r){if(typeof s==="function"){r=s;s=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(r)r.apply(this,arguments)}return s?t.call(e,i,s,callback):t.call(e,i,callback)}}function statFixSync(t){if(!t)return t;return function(i,s){var r=s?t.call(e,i,s):t.call(e,i);if(r){if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296}return r}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},238:(e,t,i)=>{"use strict";const s=i(361).EventEmitter;const r=i(552);const n=i(17);const c=i(344);const a=Object.freeze({});let o=1e3;const h=i(37).platform()==="darwin";const f=process.env.WATCHPACK_POLLING;const l=`${+f}`===f?+f:!!f&&f!=="false";function withoutCase(e){return e.toLowerCase()}function needCalls(e,t){return function(){if(--e===0){return t()}}}class Watcher extends s{constructor(e,t,i){super();this.directoryWatcher=e;this.path=t;this.startTime=i&&+i}checkStartTime(e,t){const i=this.startTime;if(typeof i!=="number")return!t;return i<=e}close(){this.emit("closed")}}class DirectoryWatcher extends s{constructor(e,t,i){super();if(l){i.poll=l}this.watcherManager=e;this.options=i;this.path=t;this.files=new Map;this.filesWithoutCase=new Map;this.directories=new Map;this.lastWatchEvent=0;this.initialScan=true;this.ignored=i.ignored||(()=>false);this.nestedWatching=false;this.polledWatching=typeof i.poll==="number"?i.poll:i.poll?5007:false;this.timeout=undefined;this.initialScanRemoved=new Set;this.initialScanFinished=undefined;this.watchers=new Map;this.parentWatcher=null;this.refs=0;this._activeEvents=new Map;this.closed=false;this.scanning=false;this.scanAgain=false;this.scanAgainInitial=false;this.createWatcher();this.doScan(true)}createWatcher(){try{if(this.polledWatching){this.watcher={close:()=>{if(this.timeout){clearTimeout(this.timeout);this.timeout=undefined}}}}else{if(h){this.watchInParentDirectory()}this.watcher=c.watch(this.path);this.watcher.on("change",this.onWatchEvent.bind(this));this.watcher.on("error",this.onWatcherError.bind(this))}}catch(e){this.onWatcherError(e)}}forEachWatcher(e,t){const i=this.watchers.get(withoutCase(e));if(i!==undefined){for(const e of i){t(e)}}}setMissing(e,t,i){if(this.initialScan){this.initialScanRemoved.add(e)}const s=this.directories.get(e);if(s){if(this.nestedWatching)s.close();this.directories.delete(e);this.forEachWatcher(e,(e=>e.emit("remove",i)));if(!t){this.forEachWatcher(this.path,(s=>s.emit("change",e,null,i,t)))}}const r=this.files.get(e);if(r){this.files.delete(e);const s=withoutCase(e);const r=this.filesWithoutCase.get(s)-1;if(r<=0){this.filesWithoutCase.delete(s);this.forEachWatcher(e,(e=>e.emit("remove",i)))}else{this.filesWithoutCase.set(s,r)}if(!t){this.forEachWatcher(this.path,(s=>s.emit("change",e,null,i,t)))}}}setFileTime(e,t,i,s,r){const n=Date.now();if(this.ignored(e))return;const c=this.files.get(e);let a,h;if(i){a=Math.min(n,t)+o;h=o}else{a=n;h=0;if(c&&c.timestamp===t&&t+o{if(!i||e.checkStartTime(a,i)){e.emit("change",t,r)}}))}else if(!i){this.forEachWatcher(e,(e=>e.emit("change",t,r)))}this.forEachWatcher(this.path,(t=>{if(!i||t.checkStartTime(a,i)){t.emit("change",e,a,r,i)}}))}setDirectory(e,t,i,s){if(this.ignored(e))return;if(e===this.path){if(!i){this.forEachWatcher(this.path,(r=>r.emit("change",e,t,s,i)))}}else{const r=this.directories.get(e);if(!r){const r=Date.now();if(this.nestedWatching){this.createNestedWatcher(e)}else{this.directories.set(e,true)}let n;if(i){n=Math.min(r,t)+o}else{n=r}this.forEachWatcher(e,(e=>{if(!i||e.checkStartTime(n,false)){e.emit("change",t,s)}}));this.forEachWatcher(this.path,(t=>{if(!i||t.checkStartTime(n,i)){t.emit("change",e,n,s,i)}}))}}}createNestedWatcher(e){const t=this.watcherManager.watchDirectory(e,1);t.on("change",((e,t,i,s)=>{this.forEachWatcher(this.path,(r=>{if(!s||r.checkStartTime(t,s)){r.emit("change",e,t,i,s)}}))}));this.directories.set(e,t)}setNestedWatching(e){if(this.nestedWatching!==!!e){this.nestedWatching=!!e;if(this.nestedWatching){for(const e of this.directories.keys()){this.createNestedWatcher(e)}}else{for(const[e,t]of this.directories){t.close();this.directories.set(e,true)}}}}watch(e,t){const i=withoutCase(e);let s=this.watchers.get(i);if(s===undefined){s=new Set;this.watchers.set(i,s)}this.refs++;const r=new Watcher(this,e,t);r.on("closed",(()=>{if(--this.refs<=0){this.close();return}s.delete(r);if(s.size===0){this.watchers.delete(i);if(this.path===e)this.setNestedWatching(false)}}));s.add(r);let n;if(e===this.path){this.setNestedWatching(true);n=this.lastWatchEvent;for(const e of this.files.values()){fixupEntryAccuracy(e);n=Math.max(n,e.safeTime)}}else{const t=this.files.get(e);if(t){fixupEntryAccuracy(t);n=t.safeTime}else{n=0}}if(n){if(n>=t){process.nextTick((()=>{if(this.closed)return;if(e===this.path){r.emit("change",e,n,"watch (outdated on attach)",true)}else{r.emit("change",n,"watch (outdated on attach)",true)}}))}}else if(this.initialScan){if(this.initialScanRemoved.has(e)){process.nextTick((()=>{if(this.closed)return;r.emit("remove")}))}}else if(!this.directories.has(e)&&r.checkStartTime(this.initialScanFinished,false)){process.nextTick((()=>{if(this.closed)return;r.emit("initial-missing","watch (missing on attach)")}))}return r}onWatchEvent(e,t){if(this.closed)return;if(!t){this.doScan(false);return}const i=n.join(this.path,t);if(this.ignored(i))return;if(this._activeEvents.get(t)===undefined){this._activeEvents.set(t,false);const checkStats=()=>{if(this.closed)return;this._activeEvents.set(t,false);r.lstat(i,((s,c)=>{if(this.closed)return;if(this._activeEvents.get(t)===true){process.nextTick(checkStats);return}this._activeEvents.delete(t);if(s){if(s.code!=="ENOENT"&&s.code!=="EPERM"&&s.code!=="EBUSY"){this.onStatsError(s)}else{if(t===n.basename(this.path)){if(!r.existsSync(this.path)){this.onDirectoryRemoved("stat failed")}}}}this.lastWatchEvent=Date.now();if(!c){this.setMissing(i,false,e)}else if(c.isDirectory()){this.setDirectory(i,+c.birthtime||1,false,e)}else if(c.isFile()||c.isSymbolicLink()){if(c.mtime){ensureFsAccuracy(c.mtime)}this.setFileTime(i,+c.mtime||+c.ctime||1,false,false,e)}}))};process.nextTick(checkStats)}else{this._activeEvents.set(t,true)}}onWatcherError(e){if(this.closed)return;if(e){if(e.code!=="EPERM"&&e.code!=="ENOENT"){console.error("Watchpack Error (watcher): "+e)}this.onDirectoryRemoved("watch error")}}onStatsError(e){if(e){console.error("Watchpack Error (stats): "+e)}}onScanError(e){if(e){console.error("Watchpack Error (initial scan): "+e)}this.onScanFinished()}onScanFinished(){if(this.polledWatching){this.timeout=setTimeout((()=>{if(this.closed)return;this.doScan(false)}),this.polledWatching)}}onDirectoryRemoved(e){if(this.watcher){this.watcher.close();this.watcher=null}this.watchInParentDirectory();const t=`directory-removed (${e})`;for(const e of this.directories.keys()){this.setMissing(e,null,t)}for(const e of this.files.keys()){this.setMissing(e,null,t)}}watchInParentDirectory(){if(!this.parentWatcher){const e=n.dirname(this.path);if(n.dirname(e)===e)return;this.parentWatcher=this.watcherManager.watchFile(this.path,1);this.parentWatcher.on("change",((e,t)=>{if(this.closed)return;if((!h||this.polledWatching)&&this.parentWatcher){this.parentWatcher.close();this.parentWatcher=null}if(!this.watcher){this.createWatcher();this.doScan(false);this.forEachWatcher(this.path,(i=>i.emit("change",this.path,e,t,false)))}}));this.parentWatcher.on("remove",(()=>{this.onDirectoryRemoved("parent directory removed")}))}}doScan(e){if(this.scanning){if(this.scanAgain){if(!e)this.scanAgainInitial=false}else{this.scanAgain=true;this.scanAgainInitial=e}return}this.scanning=true;if(this.timeout){clearTimeout(this.timeout);this.timeout=undefined}process.nextTick((()=>{if(this.closed)return;r.readdir(this.path,((t,i)=>{if(this.closed)return;if(t){if(t.code==="ENOENT"||t.code==="EPERM"){this.onDirectoryRemoved("scan readdir failed")}else{this.onScanError(t)}this.initialScan=false;this.initialScanFinished=Date.now();if(e){for(const e of this.watchers.values()){for(const t of e){if(t.checkStartTime(this.initialScanFinished,false)){t.emit("initial-missing","scan (parent directory missing in initial scan)")}}}}if(this.scanAgain){this.scanAgain=false;this.doScan(this.scanAgainInitial)}else{this.scanning=false}return}const s=new Set(i.map((e=>n.join(this.path,e.normalize("NFC")))));for(const t of this.files.keys()){if(!s.has(t)){this.setMissing(t,e,"scan (missing)")}}for(const t of this.directories.keys()){if(!s.has(t)){this.setMissing(t,e,"scan (missing)")}}if(this.scanAgain){this.scanAgain=false;this.doScan(e);return}const c=needCalls(s.size+1,(()=>{if(this.closed)return;this.initialScan=false;this.initialScanRemoved=null;this.initialScanFinished=Date.now();if(e){const e=new Map(this.watchers);e.delete(withoutCase(this.path));for(const t of s){e.delete(withoutCase(t))}for(const t of e.values()){for(const e of t){if(e.checkStartTime(this.initialScanFinished,false)){e.emit("initial-missing","scan (missing in initial scan)")}}}}if(this.scanAgain){this.scanAgain=false;this.doScan(this.scanAgainInitial)}else{this.scanning=false;this.onScanFinished()}}));for(const t of s){r.lstat(t,((i,s)=>{if(this.closed)return;if(i){if(i.code==="ENOENT"||i.code==="EPERM"||i.code==="EACCES"||i.code==="EBUSY"){this.setMissing(t,e,"scan ("+i.code+")")}else{this.onScanError(i)}c();return}if(s.isFile()||s.isSymbolicLink()){if(s.mtime){ensureFsAccuracy(s.mtime)}this.setFileTime(t,+s.mtime||+s.ctime||1,e,true,"scan (file)")}else if(s.isDirectory()){if(!e||!this.directories.has(t))this.setDirectory(t,+s.birthtime||1,e,"scan (dir)")}c()}))}c()}))}))}getTimes(){const e=Object.create(null);let t=this.lastWatchEvent;for(const[i,s]of this.files){fixupEntryAccuracy(s);t=Math.max(t,s.safeTime);e[i]=Math.max(s.safeTime,s.timestamp)}if(this.nestedWatching){for(const i of this.directories.values()){const s=i.directoryWatcher.getTimes();for(const i of Object.keys(s)){const r=s[i];t=Math.max(t,r);e[i]=r}}e[this.path]=t}if(!this.initialScan){for(const t of this.watchers.values()){for(const i of t){const t=i.path;if(!Object.prototype.hasOwnProperty.call(e,t)){e[t]=null}}}}return e}collectTimeInfoEntries(e,t){let i=this.lastWatchEvent;for(const[t,s]of this.files){fixupEntryAccuracy(s);i=Math.max(i,s.safeTime);e.set(t,s)}if(this.nestedWatching){for(const s of this.directories.values()){i=Math.max(i,s.directoryWatcher.collectTimeInfoEntries(e,t))}e.set(this.path,a);t.set(this.path,{safeTime:i})}else{for(const i of this.directories.keys()){e.set(i,a);if(!t.has(i))t.set(i,a)}e.set(this.path,a);t.set(this.path,a)}if(!this.initialScan){for(const t of this.watchers.values()){for(const i of t){const t=i.path;if(!e.has(t)){e.set(t,null)}}}}return i}close(){this.closed=true;this.initialScan=false;if(this.watcher){this.watcher.close();this.watcher=null}if(this.nestedWatching){for(const e of this.directories.values()){e.close()}this.directories.clear()}if(this.parentWatcher){this.parentWatcher.close();this.parentWatcher=null}this.emit("closed")}}e.exports=DirectoryWatcher;e.exports.EXISTANCE_ONLY_TIME_ENTRY=a;function fixupEntryAccuracy(e){if(e.accuracy>o){e.safeTime=e.safeTime-e.accuracy+o;e.accuracy=o}}function ensureFsAccuracy(e){if(!e)return;if(o>1&&e%1!==0)o=1;else if(o>10&&e%10!==0)o=10;else if(o>100&&e%100!==0)o=100}},669:(e,t,i)=>{"use strict";const s=i(147);const r=i(17);const n=new Set(["EINVAL","ENOENT"]);if(process.platform==="win32")n.add("UNKNOWN");class LinkResolver{constructor(){this.cache=new Map}resolve(e){const t=this.cache.get(e);if(t!==undefined){return t}const i=r.dirname(e);if(i===e){const t=Object.freeze([e]);this.cache.set(e,t);return t}const c=this.resolve(i);let a=e;if(c[0]!==i){const t=r.basename(e);a=r.resolve(c[0],t)}try{const t=s.readlinkSync(a);const i=r.resolve(c[0],t);const n=this.resolve(i);let o;if(n.length>1&&c.length>1){const e=new Set(n);e.add(a);for(let t=1;t1){o=c.slice();o[0]=n[0];o.push(a);Object.freeze(o)}else if(n.length>1){o=n.slice();o.push(a);Object.freeze(o)}else{o=Object.freeze([n[0],a])}this.cache.set(e,o);return o}catch(t){if(!n.has(t.code)){throw t}const i=c.slice();i[0]=a;Object.freeze(i);this.cache.set(e,i);return i}}}e.exports=LinkResolver},399:(e,t,i)=>{"use strict";const s=i(17);const r=i(238);class WatcherManager{constructor(e){this.options=e;this.directoryWatchers=new Map}getDirectoryWatcher(e){const t=this.directoryWatchers.get(e);if(t===undefined){const t=new r(this,e,this.options);this.directoryWatchers.set(e,t);t.on("closed",(()=>{this.directoryWatchers.delete(e)}));return t}return t}watchFile(e,t){const i=s.dirname(e);if(i===e)return null;return this.getDirectoryWatcher(i).watch(e,t)}watchDirectory(e,t){return this.getDirectoryWatcher(e).watch(e,t)}}const n=new WeakMap;e.exports=e=>{const t=n.get(e);if(t!==undefined)return t;const i=new WatcherManager(e);n.set(e,i);return i};e.exports.WatcherManager=WatcherManager},385:(e,t,i)=>{"use strict";const s=i(17);e.exports=(e,t)=>{const i=new Map;for(const[t,s]of e){i.set(t,{filePath:t,parent:undefined,children:undefined,entries:1,active:true,value:s})}let r=i.size;for(const e of i.values()){const t=s.dirname(e.filePath);if(t!==e.filePath){let s=i.get(t);if(s===undefined){s={filePath:t,parent:undefined,children:[e],entries:e.entries,active:false,value:undefined};i.set(t,s);e.parent=s}else{e.parent=s;if(s.children===undefined){s.children=[e]}else{s.children.push(e)}do{s.entries+=e.entries;s=s.parent}while(s)}}}while(r>t){const e=r-t;let s=undefined;let n=Infinity;for(const r of i.values()){if(r.entries<=1||!r.children||!r.parent)continue;if(r.children.length===0)continue;if(r.children.length===1&&!r.value)continue;const i=r.entries-1>=e?r.entries-1-e:e-r.entries+1+t*.3;if(i{"use strict";const s=i(147);const r=i(17);const{EventEmitter:n}=i(361);const c=i(385);const a=i(37).platform()==="darwin";const o=i(37).platform()==="win32";const h=a||o;const f=+process.env.WATCHPACK_WATCHER_LIMIT||(a?2e3:1e4);const l=!!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING;let u=false;let d=0;const p=new Map;const m=new Map;const g=new Map;const y=new Map;class DirectWatcher{constructor(e){this.filePath=e;this.watchers=new Set;this.watcher=undefined;try{const t=s.watch(e);this.watcher=t;t.on("change",((e,t)=>{for(const i of this.watchers){i.emit("change",e,t)}}));t.on("error",(e=>{for(const t of this.watchers){t.emit("error",e)}}))}catch(e){process.nextTick((()=>{for(const t of this.watchers){t.emit("error",e)}}))}d++}add(e){y.set(e,this);this.watchers.add(e)}remove(e){this.watchers.delete(e);if(this.watchers.size===0){g.delete(this.filePath);d--;if(this.watcher)this.watcher.close()}}getWatchers(){return this.watchers}}class RecursiveWatcher{constructor(e){this.rootPath=e;this.mapWatcherToPath=new Map;this.mapPathToWatchers=new Map;this.watcher=undefined;try{const t=s.watch(e,{recursive:true});this.watcher=t;t.on("change",((e,t)=>{if(!t){if(l){process.stderr.write(`[watchpack] dispatch ${e} event in recursive watcher (${this.rootPath}) to all watchers\n`)}for(const t of this.mapWatcherToPath.keys()){t.emit("change",e)}}else{const i=r.dirname(t);const s=this.mapPathToWatchers.get(i);if(l){process.stderr.write(`[watchpack] dispatch ${e} event in recursive watcher (${this.rootPath}) for '${t}' to ${s?s.size:0} watchers\n`)}if(s===undefined)return;for(const i of s){i.emit("change",e,r.basename(t))}}}));t.on("error",(e=>{for(const t of this.mapWatcherToPath.keys()){t.emit("error",e)}}))}catch(e){process.nextTick((()=>{for(const t of this.mapWatcherToPath.keys()){t.emit("error",e)}}))}d++;if(l){process.stderr.write(`[watchpack] created recursive watcher at ${e}\n`)}}add(e,t){y.set(t,this);const i=e.slice(this.rootPath.length+1)||".";this.mapWatcherToPath.set(t,i);const s=this.mapPathToWatchers.get(i);if(s===undefined){const e=new Set;e.add(t);this.mapPathToWatchers.set(i,e)}else{s.add(t)}}remove(e){const t=this.mapWatcherToPath.get(e);if(!t)return;this.mapWatcherToPath.delete(e);const i=this.mapPathToWatchers.get(t);i.delete(e);if(i.size===0){this.mapPathToWatchers.delete(t)}if(this.mapWatcherToPath.size===0){m.delete(this.rootPath);d--;if(this.watcher)this.watcher.close();if(l){process.stderr.write(`[watchpack] closed recursive watcher at ${this.rootPath}\n`)}}}getWatchers(){return this.mapWatcherToPath}}class Watcher extends n{close(){if(p.has(this)){p.delete(this);return}const e=y.get(this);e.remove(this);y.delete(this)}}const createDirectWatcher=e=>{const t=g.get(e);if(t!==undefined)return t;const i=new DirectWatcher(e);g.set(e,i);return i};const createRecursiveWatcher=e=>{const t=m.get(e);if(t!==undefined)return t;const i=new RecursiveWatcher(e);m.set(e,i);return i};const execute=()=>{const e=new Map;const addWatcher=(t,i)=>{const s=e.get(i);if(s===undefined){e.set(i,t)}else if(Array.isArray(s)){s.push(t)}else{e.set(i,[s,t])}};for(const[e,t]of p){addWatcher(e,t)}p.clear();if(!h||f-d>=e.size){for(const[t,i]of e){const e=createDirectWatcher(t);if(Array.isArray(i)){for(const t of i)e.add(t)}else{e.add(i)}}return}for(const e of m.values()){for(const[t,i]of e.getWatchers()){addWatcher(t,r.join(e.rootPath,i))}}for(const e of g.values()){for(const t of e.getWatchers()){addWatcher(t,e.filePath)}}const t=c(e,f*.9);for(const[e,i]of t){if(i.size===1){for(const[e,t]of i){const i=createDirectWatcher(t);const s=y.get(e);if(s===i)continue;i.add(e);if(s!==undefined)s.remove(e)}}else{const t=new Set(i.values());if(t.size>1){const t=createRecursiveWatcher(e);for(const[e,s]of i){const i=y.get(e);if(i===t)continue;t.add(s,e);if(i!==undefined)i.remove(e)}}else{for(const e of t){const t=createDirectWatcher(e);for(const e of i.keys()){const i=y.get(e);if(i===t)continue;t.add(e);if(i!==undefined)i.remove(e)}}}}}};t.watch=e=>{const t=new Watcher;const i=g.get(e);if(i!==undefined){i.add(t);return t}let s=e;for(;;){const i=m.get(s);if(i!==undefined){i.add(e,t);return t}const n=r.dirname(s);if(n===s)break;s=n}p.set(t,e);if(!u)execute();return t};t.batch=e=>{u=true;try{e()}finally{u=false;execute()}};t.getNumberOfWatchers=()=>d},375:(e,t,i)=>{"use strict";const s=i(399);const r=i(669);const n=i(361).EventEmitter;const c=i(140);const a=i(344);const o=[];const h={};function addWatchersToSet(e,t){for(const i of e){const e=i.watcher;if(!t.has(e.directoryWatcher)){t.add(e.directoryWatcher)}}}const stringToRegexp=e=>{const t=c(e,{globstar:true,extended:true}).source;const i=t.slice(0,t.length-1)+"(?:$|\\/)";return i};const ignoredToFunction=e=>{if(Array.isArray(e)){const t=new RegExp(e.map((e=>stringToRegexp(e))).join("|"));return e=>t.test(e.replace(/\\/g,"/"))}else if(typeof e==="string"){const t=new RegExp(stringToRegexp(e));return e=>t.test(e.replace(/\\/g,"/"))}else if(e instanceof RegExp){return t=>e.test(t.replace(/\\/g,"/"))}else if(e instanceof Function){return e}else if(e){throw new Error(`Invalid option for 'ignored': ${e}`)}else{return()=>false}};const normalizeOptions=e=>({followSymlinks:!!e.followSymlinks,ignored:ignoredToFunction(e.ignored),poll:e.poll});const f=new WeakMap;const cachedNormalizeOptions=e=>{const t=f.get(e);if(t!==undefined)return t;const i=normalizeOptions(e);f.set(e,i);return i};class WatchpackFileWatcher{constructor(e,t,i){this.files=Array.isArray(i)?i:[i];this.watcher=t;t.on("initial-missing",(t=>{for(const i of this.files){if(!e._missing.has(i))e._onRemove(i,i,t)}}));t.on("change",((t,i)=>{for(const s of this.files){e._onChange(s,t,s,i)}}));t.on("remove",(t=>{for(const i of this.files){e._onRemove(i,i,t)}}))}update(e){if(!Array.isArray(e)){if(this.files.length!==1){this.files=[e]}else if(this.files[0]!==e){this.files[0]=e}}else{this.files=e}}close(){this.watcher.close()}}class WatchpackDirectoryWatcher{constructor(e,t,i){this.directories=Array.isArray(i)?i:[i];this.watcher=t;t.on("initial-missing",(t=>{for(const i of this.directories){e._onRemove(i,i,t)}}));t.on("change",((t,i,s)=>{for(const r of this.directories){e._onChange(r,i,t,s)}}));t.on("remove",(t=>{for(const i of this.directories){e._onRemove(i,i,t)}}))}update(e){if(!Array.isArray(e)){if(this.directories.length!==1){this.directories=[e]}else if(this.directories[0]!==e){this.directories[0]=e}}else{this.directories=e}}close(){this.watcher.close()}}class Watchpack extends n{constructor(e){super();if(!e)e=h;this.options=e;this.aggregateTimeout=typeof e.aggregateTimeout==="number"?e.aggregateTimeout:200;this.watcherOptions=cachedNormalizeOptions(e);this.watcherManager=s(this.watcherOptions);this.fileWatchers=new Map;this.directoryWatchers=new Map;this._missing=new Set;this.startTime=undefined;this.paused=false;this.aggregatedChanges=new Set;this.aggregatedRemovals=new Set;this.aggregateTimer=undefined;this._onTimeout=this._onTimeout.bind(this)}watch(e,t,i){let s,n,c,h;if(!t){({files:s=o,directories:n=o,missing:c=o,startTime:h}=e)}else{s=e;n=t;c=o;h=i}this.paused=false;const f=this.fileWatchers;const l=this.directoryWatchers;const u=this.watcherOptions.ignored;const filter=e=>!u(e);const addToMap=(e,t,i)=>{const s=e.get(t);if(s===undefined){e.set(t,i)}else if(Array.isArray(s)){s.push(i)}else{e.set(t,[s,i])}};const d=new Map;const p=new Map;const m=new Set;if(this.watcherOptions.followSymlinks){const e=new r;for(const t of s){if(filter(t)){for(const i of e.resolve(t)){if(t===i||filter(i)){addToMap(d,i,t)}}}}for(const t of c){if(filter(t)){for(const i of e.resolve(t)){if(t===i||filter(i)){m.add(t);addToMap(d,i,t)}}}}for(const t of n){if(filter(t)){let i=true;for(const s of e.resolve(t)){if(filter(s)){addToMap(i?p:d,s,t)}i=false}}}}else{for(const e of s){if(filter(e)){addToMap(d,e,e)}}for(const e of c){if(filter(e)){m.add(e);addToMap(d,e,e)}}for(const e of n){if(filter(e)){addToMap(p,e,e)}}}for(const[e,t]of f){const i=d.get(e);if(i===undefined){t.close();f.delete(e)}else{t.update(i);d.delete(e)}}for(const[e,t]of l){const i=p.get(e);if(i===undefined){t.close();l.delete(e)}else{t.update(i);p.delete(e)}}a.batch((()=>{for(const[e,t]of d){const i=this.watcherManager.watchFile(e,h);if(i){f.set(e,new WatchpackFileWatcher(this,i,t))}}for(const[e,t]of p){const i=this.watcherManager.watchDirectory(e,h);if(i){l.set(e,new WatchpackDirectoryWatcher(this,i,t))}}}));this._missing=m;this.startTime=h}close(){this.paused=true;if(this.aggregateTimer)clearTimeout(this.aggregateTimer);for(const e of this.fileWatchers.values())e.close();for(const e of this.directoryWatchers.values())e.close();this.fileWatchers.clear();this.directoryWatchers.clear()}pause(){this.paused=true;if(this.aggregateTimer)clearTimeout(this.aggregateTimer)}getTimes(){const e=new Set;addWatchersToSet(this.fileWatchers.values(),e);addWatchersToSet(this.directoryWatchers.values(),e);const t=Object.create(null);for(const i of e){const e=i.getTimes();for(const i of Object.keys(e))t[i]=e[i]}return t}getTimeInfoEntries(){const e=new Map;this.collectTimeInfoEntries(e,e);return e}collectTimeInfoEntries(e,t){const i=new Set;addWatchersToSet(this.fileWatchers.values(),i);addWatchersToSet(this.directoryWatchers.values(),i);const s={value:0};for(const r of i){r.collectTimeInfoEntries(e,t,s)}}getAggregated(){if(this.aggregateTimer){clearTimeout(this.aggregateTimer);this.aggregateTimer=undefined}const e=this.aggregatedChanges;const t=this.aggregatedRemovals;this.aggregatedChanges=new Set;this.aggregatedRemovals=new Set;return{changes:e,removals:t}}_onChange(e,t,i,s){i=i||e;if(!this.paused){this.emit("change",i,t,s);if(this.aggregateTimer)clearTimeout(this.aggregateTimer);this.aggregateTimer=setTimeout(this._onTimeout,this.aggregateTimeout)}this.aggregatedRemovals.delete(e);this.aggregatedChanges.add(e)}_onRemove(e,t,i){t=t||e;if(!this.paused){this.emit("remove",t,i);if(this.aggregateTimer)clearTimeout(this.aggregateTimer);this.aggregateTimer=setTimeout(this._onTimeout,this.aggregateTimeout)}this.aggregatedChanges.delete(e);this.aggregatedRemovals.add(e)}_onTimeout(){this.aggregateTimer=undefined;const e=this.aggregatedChanges;const t=this.aggregatedRemovals;this.aggregatedChanges=new Set;this.aggregatedRemovals=new Set;this.emit("aggregated",e,t)}}e.exports=Watchpack},491:e=>{"use strict";e.exports=require("assert")},57:e=>{"use strict";e.exports=require("constants")},361:e=>{"use strict";e.exports=require("events")},147:e=>{"use strict";e.exports=require("fs")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},781:e=>{"use strict";e.exports=require("stream")},837:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(i){var s=t[i];if(s!==undefined){return s.exports}var r=t[i]={exports:{}};var n=true;try{e[i](r,r.exports,__nccwpck_require__);n=false}finally{if(n)delete t[i]}return r.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(375);module.exports=i})(); \ No newline at end of file diff --git a/packages/next/compiled/webpack/bundle5.js b/packages/next/compiled/webpack/bundle5.js index 4449d7ce0626700..1ed5d251ff7af7f 100644 --- a/packages/next/compiled/webpack/bundle5.js +++ b/packages/next/compiled/webpack/bundle5.js @@ -9683,7 +9683,7 @@ function importAssertions(Parser) { * https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU */ Object.defineProperty(exports, "__esModule", ({ value: true })); -var tslib_1 = __webpack_require__(30036); +var tslib_1 = __webpack_require__(32087); var stream_1 = __webpack_require__(12781); function evCommon() { var hrtime = process.hrtime(); // [seconds, nanoseconds] @@ -9856,6681 +9856,8 @@ exports.Tracer = Tracer; /***/ }), -/***/ 70665: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -const Variable = __webpack_require__(82971); - -/** - * @class Definition - */ -class Definition { - constructor(type, name, node, parent, index, kind) { - - /** - * @member {String} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). - */ - this.type = type; - - /** - * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. - */ - this.name = name; - - /** - * @member {espree.Node} Definition#node - the enclosing node of the identifier. - */ - this.node = node; - - /** - * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. - */ - this.parent = parent; - - /** - * @member {Number?} Definition#index - the index in the declaration statement. - */ - this.index = index; - - /** - * @member {String?} Definition#kind - the kind of the declaration statement. - */ - this.kind = kind; - } -} - -/** - * @class ParameterDefinition - */ -class ParameterDefinition extends Definition { - constructor(name, node, index, rest) { - super(Variable.Parameter, name, node, null, index, null); - - /** - * Whether the parameter definition is a part of a rest parameter. - * @member {boolean} ParameterDefinition#rest - */ - this.rest = rest; - } -} - -module.exports = { - ParameterDefinition, - Definition -}; - -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 36007: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - Copyright (C) 2012-2014 Yusuke Suzuki - Copyright (C) 2013 Alex Seville - Copyright (C) 2014 Thiago de Arruda - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * Escope (escope) is an ECMAScript - * scope analyzer extracted from the esmangle project. - *

- * escope finds lexical scopes in a source program, i.e. areas of that - * program where different occurrences of the same identifier refer to the same - * variable. With each scope the contained variables are collected, and each - * identifier reference in code is linked to its corresponding variable (if - * possible). - *

- * escope works on a syntax tree of the parsed source code which has - * to adhere to the - * Mozilla Parser API. E.g. espree is a parser - * that produces such syntax trees. - *

- * The main interface is the {@link analyze} function. - * @module escope - */ - - -/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */ - -const assert = __webpack_require__(39491); - -const ScopeManager = __webpack_require__(96988); -const Referencer = __webpack_require__(44585); -const Reference = __webpack_require__(64945); -const Variable = __webpack_require__(82971); -const Scope = (__webpack_require__(16313).Scope); -const version = (__webpack_require__(30290)/* .version */ .i8); - -/** - * Set the default options - * @returns {Object} options - */ -function defaultOptions() { - return { - optimistic: false, - directive: false, - nodejsScope: false, - impliedStrict: false, - sourceType: "script", // one of ['script', 'module'] - ecmaVersion: 5, - childVisitorKeys: null, - fallback: "iteration" - }; -} - -/** - * Preform deep update on option object - * @param {Object} target - Options - * @param {Object} override - Updates - * @returns {Object} Updated options - */ -function updateDeeply(target, override) { - - /** - * Is hash object - * @param {Object} value - Test value - * @returns {boolean} Result - */ - function isHashObject(value) { - return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); - } - - for (const key in override) { - if (Object.prototype.hasOwnProperty.call(override, key)) { - const val = override[key]; - - if (isHashObject(val)) { - if (isHashObject(target[key])) { - updateDeeply(target[key], val); - } else { - target[key] = updateDeeply({}, val); - } - } else { - target[key] = val; - } - } - } - return target; -} - -/** - * Main interface function. Takes an Espree syntax tree and returns the - * analyzed scopes. - * @function analyze - * @param {espree.Tree} tree - Abstract Syntax Tree - * @param {Object} providedOptions - Options that tailor the scope analysis - * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag - * @param {boolean} [providedOptions.directive=false]- the directive flag - * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls - * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole - * script is executed under node.js environment. When enabled, escope adds - * a function scope immediately following the global scope. - * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode - * (if ecmaVersion >= 5). - * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' - * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered - * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. - * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. - * @returns {ScopeManager} ScopeManager - */ -function analyze(tree, providedOptions) { - const options = updateDeeply(defaultOptions(), providedOptions); - const scopeManager = new ScopeManager(options); - const referencer = new Referencer(options, scopeManager); - - referencer.visit(tree); - - assert(scopeManager.__currentScope === null, "currentScope should be null."); - - return scopeManager; -} - -module.exports = { - - /** @name module:escope.version */ - version, - - /** @name module:escope.Reference */ - Reference, - - /** @name module:escope.Variable */ - Variable, - - /** @name module:escope.Scope */ - Scope, - - /** @name module:escope.ScopeManager */ - ScopeManager, - analyze -}; - - -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 54162: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -/* eslint-disable no-undefined */ - -const Syntax = (__webpack_require__(18350).Syntax); -const esrecurse = __webpack_require__(81217); - -/** - * Get last array element - * @param {array} xs - array - * @returns {any} Last elment - */ -function getLast(xs) { - return xs[xs.length - 1] || null; -} - -class PatternVisitor extends esrecurse.Visitor { - static isPattern(node) { - const nodeType = node.type; - - return ( - nodeType === Syntax.Identifier || - nodeType === Syntax.ObjectPattern || - nodeType === Syntax.ArrayPattern || - nodeType === Syntax.SpreadElement || - nodeType === Syntax.RestElement || - nodeType === Syntax.AssignmentPattern - ); - } - - constructor(options, rootPattern, callback) { - super(null, options); - this.rootPattern = rootPattern; - this.callback = callback; - this.assignments = []; - this.rightHandNodes = []; - this.restElements = []; - } - - Identifier(pattern) { - const lastRestElement = getLast(this.restElements); - - this.callback(pattern, { - topLevel: pattern === this.rootPattern, - rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern, - assignments: this.assignments - }); - } - - Property(property) { - - // Computed property's key is a right hand node. - if (property.computed) { - this.rightHandNodes.push(property.key); - } - - // If it's shorthand, its key is same as its value. - // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). - // If it's not shorthand, the name of new variable is its value's. - this.visit(property.value); - } - - ArrayPattern(pattern) { - for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { - const element = pattern.elements[i]; - - this.visit(element); - } - } - - AssignmentPattern(pattern) { - this.assignments.push(pattern); - this.visit(pattern.left); - this.rightHandNodes.push(pattern.right); - this.assignments.pop(); - } - - RestElement(pattern) { - this.restElements.push(pattern); - this.visit(pattern.argument); - this.restElements.pop(); - } - - MemberExpression(node) { - - // Computed property's key is a right hand node. - if (node.computed) { - this.rightHandNodes.push(node.property); - } - - // the object is only read, write to its property. - this.rightHandNodes.push(node.object); - } - - // - // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. - // By spec, LeftHandSideExpression is Pattern or MemberExpression. - // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) - // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... - // - - SpreadElement(node) { - this.visit(node.argument); - } - - ArrayExpression(node) { - node.elements.forEach(this.visit, this); - } - - AssignmentExpression(node) { - this.assignments.push(node); - this.visit(node.left); - this.rightHandNodes.push(node.right); - this.assignments.pop(); - } - - CallExpression(node) { - - // arguments are right hand nodes. - node.arguments.forEach(a => { - this.rightHandNodes.push(a); - }); - this.visit(node.callee); - } -} - -module.exports = PatternVisitor; - -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 64945: -/***/ (function(module) { - -"use strict"; -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -const READ = 0x1; -const WRITE = 0x2; -const RW = READ | WRITE; - -/** - * A Reference represents a single occurrence of an identifier in code. - * @class Reference - */ -class Reference { - constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { - - /** - * Identifier syntax node. - * @member {espreeIdentifier} Reference#identifier - */ - this.identifier = ident; - - /** - * Reference to the enclosing Scope. - * @member {Scope} Reference#from - */ - this.from = scope; - - /** - * Whether the reference comes from a dynamic scope (such as 'eval', - * 'with', etc.), and may be trapped by dynamic scopes. - * @member {boolean} Reference#tainted - */ - this.tainted = false; - - /** - * The variable this reference is resolved with. - * @member {Variable} Reference#resolved - */ - this.resolved = null; - - /** - * The read-write mode of the reference. (Value is one of {@link - * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). - * @member {number} Reference#flag - * @private - */ - this.flag = flag; - if (this.isWrite()) { - - /** - * If reference is writeable, this is the tree being written to it. - * @member {espreeNode} Reference#writeExpr - */ - this.writeExpr = writeExpr; - - /** - * Whether the Reference might refer to a partial value of writeExpr. - * @member {boolean} Reference#partial - */ - this.partial = partial; - - /** - * Whether the Reference is to write of initialization. - * @member {boolean} Reference#init - */ - this.init = init; - } - this.__maybeImplicitGlobal = maybeImplicitGlobal; - } - - /** - * Whether the reference is static. - * @method Reference#isStatic - * @returns {boolean} static - */ - isStatic() { - return !this.tainted && this.resolved && this.resolved.scope.isStatic(); - } - - /** - * Whether the reference is writeable. - * @method Reference#isWrite - * @returns {boolean} write - */ - isWrite() { - return !!(this.flag & Reference.WRITE); - } - - /** - * Whether the reference is readable. - * @method Reference#isRead - * @returns {boolean} read - */ - isRead() { - return !!(this.flag & Reference.READ); - } - - /** - * Whether the reference is read-only. - * @method Reference#isReadOnly - * @returns {boolean} read only - */ - isReadOnly() { - return this.flag === Reference.READ; - } - - /** - * Whether the reference is write-only. - * @method Reference#isWriteOnly - * @returns {boolean} write only - */ - isWriteOnly() { - return this.flag === Reference.WRITE; - } - - /** - * Whether the reference is read-write. - * @method Reference#isReadWrite - * @returns {boolean} read write - */ - isReadWrite() { - return this.flag === Reference.RW; - } -} - -/** - * @constant Reference.READ - * @private - */ -Reference.READ = READ; - -/** - * @constant Reference.WRITE - * @private - */ -Reference.WRITE = WRITE; - -/** - * @constant Reference.RW - * @private - */ -Reference.RW = RW; - -module.exports = Reference; - -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 44585: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -/* eslint-disable no-underscore-dangle */ -/* eslint-disable no-undefined */ - -const Syntax = (__webpack_require__(18350).Syntax); -const esrecurse = __webpack_require__(81217); -const Reference = __webpack_require__(64945); -const Variable = __webpack_require__(82971); -const PatternVisitor = __webpack_require__(54162); -const definition = __webpack_require__(70665); -const assert = __webpack_require__(39491); - -const ParameterDefinition = definition.ParameterDefinition; -const Definition = definition.Definition; - -/** - * Traverse identifier in pattern - * @param {Object} options - options - * @param {pattern} rootPattern - root pattern - * @param {Refencer} referencer - referencer - * @param {callback} callback - callback - * @returns {void} - */ -function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { - - // Call the callback at left hand identifier nodes, and Collect right hand nodes. - const visitor = new PatternVisitor(options, rootPattern, callback); - - visitor.visit(rootPattern); - - // Process the right hand nodes recursively. - if (referencer !== null && referencer !== undefined) { - visitor.rightHandNodes.forEach(referencer.visit, referencer); - } -} - -// Importing ImportDeclaration. -// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation -// https://github.com/estree/estree/blob/master/es6.md#importdeclaration -// FIXME: Now, we don't create module environment, because the context is -// implementation dependent. - -class Importer extends esrecurse.Visitor { - constructor(declaration, referencer) { - super(null, referencer.options); - this.declaration = declaration; - this.referencer = referencer; - } - - visitImport(id, specifier) { - this.referencer.visitPattern(id, pattern => { - this.referencer.currentScope().__define(pattern, - new Definition( - Variable.ImportBinding, - pattern, - specifier, - this.declaration, - null, - null - )); - }); - } - - ImportNamespaceSpecifier(node) { - const local = (node.local || node.id); - - if (local) { - this.visitImport(local, node); - } - } - - ImportDefaultSpecifier(node) { - const local = (node.local || node.id); - - this.visitImport(local, node); - } - - ImportSpecifier(node) { - const local = (node.local || node.id); - - if (node.name) { - this.visitImport(node.name, node); - } else { - this.visitImport(local, node); - } - } -} - -// Referencing variables and creating bindings. -class Referencer extends esrecurse.Visitor { - constructor(options, scopeManager) { - super(null, options); - this.options = options; - this.scopeManager = scopeManager; - this.parent = null; - this.isInnerMethodDefinition = false; - } - - currentScope() { - return this.scopeManager.__currentScope; - } - - close(node) { - while (this.currentScope() && node === this.currentScope().block) { - this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); - } - } - - pushInnerMethodDefinition(isInnerMethodDefinition) { - const previous = this.isInnerMethodDefinition; - - this.isInnerMethodDefinition = isInnerMethodDefinition; - return previous; - } - - popInnerMethodDefinition(isInnerMethodDefinition) { - this.isInnerMethodDefinition = isInnerMethodDefinition; - } - - referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { - const scope = this.currentScope(); - - assignments.forEach(assignment => { - scope.__referencing( - pattern, - Reference.WRITE, - assignment.right, - maybeImplicitGlobal, - pattern !== assignment.left, - init - ); - }); - } - - visitPattern(node, options, callback) { - let visitPatternOptions = options; - let visitPatternCallback = callback; - - if (typeof options === "function") { - visitPatternCallback = options; - visitPatternOptions = { processRightHandNodes: false }; - } - - traverseIdentifierInPattern( - this.options, - node, - visitPatternOptions.processRightHandNodes ? this : null, - visitPatternCallback - ); - } - - visitFunction(node) { - let i, iz; - - // FunctionDeclaration name is defined in upper scope - // NOTE: Not referring variableScope. It is intended. - // Since - // in ES5, FunctionDeclaration should be in FunctionBody. - // in ES6, FunctionDeclaration should be block scoped. - - if (node.type === Syntax.FunctionDeclaration) { - - // id is defined in upper scope - this.currentScope().__define(node.id, - new Definition( - Variable.FunctionName, - node.id, - node, - null, - null, - null - )); - } - - // FunctionExpression with name creates its special scope; - // FunctionExpressionNameScope. - if (node.type === Syntax.FunctionExpression && node.id) { - this.scopeManager.__nestFunctionExpressionNameScope(node); - } - - // Consider this function is in the MethodDefinition. - this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); - - const that = this; - - /** - * Visit pattern callback - * @param {pattern} pattern - pattern - * @param {Object} info - info - * @returns {void} - */ - function visitPatternCallback(pattern, info) { - that.currentScope().__define(pattern, - new ParameterDefinition( - pattern, - node, - i, - info.rest - )); - - that.referencingDefaultValue(pattern, info.assignments, null, true); - } - - // Process parameter declarations. - for (i = 0, iz = node.params.length; i < iz; ++i) { - this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); - } - - // if there's a rest argument, add that - if (node.rest) { - this.visitPattern({ - type: "RestElement", - argument: node.rest - }, pattern => { - this.currentScope().__define(pattern, - new ParameterDefinition( - pattern, - node, - node.params.length, - true - )); - }); - } - - // In TypeScript there are a number of function-like constructs which have no body, - // so check it exists before traversing - if (node.body) { - - // Skip BlockStatement to prevent creating BlockStatement scope. - if (node.body.type === Syntax.BlockStatement) { - this.visitChildren(node.body); - } else { - this.visit(node.body); - } - } - - this.close(node); - } - - visitClass(node) { - if (node.type === Syntax.ClassDeclaration) { - this.currentScope().__define(node.id, - new Definition( - Variable.ClassName, - node.id, - node, - null, - null, - null - )); - } - - this.visit(node.superClass); - - this.scopeManager.__nestClassScope(node); - - if (node.id) { - this.currentScope().__define(node.id, - new Definition( - Variable.ClassName, - node.id, - node - )); - } - this.visit(node.body); - - this.close(node); - } - - visitProperty(node) { - let previous; - - if (node.computed) { - this.visit(node.key); - } - - const isMethodDefinition = node.type === Syntax.MethodDefinition; - - if (isMethodDefinition) { - previous = this.pushInnerMethodDefinition(true); - } - this.visit(node.value); - if (isMethodDefinition) { - this.popInnerMethodDefinition(previous); - } - } - - visitForIn(node) { - if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { - this.scopeManager.__nestForScope(node); - } - - if (node.left.type === Syntax.VariableDeclaration) { - this.visit(node.left); - this.visitPattern(node.left.declarations[0].id, pattern => { - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); - }); - } else { - this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { - let maybeImplicitGlobal = null; - - if (!this.currentScope().isStrict) { - maybeImplicitGlobal = { - pattern, - node - }; - } - this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); - }); - } - this.visit(node.right); - this.visit(node.body); - - this.close(node); - } - - visitVariableDeclaration(variableTargetScope, type, node, index) { - - const decl = node.declarations[index]; - const init = decl.init; - - this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { - variableTargetScope.__define( - pattern, - new Definition( - type, - pattern, - decl, - node, - index, - node.kind - ) - ); - - this.referencingDefaultValue(pattern, info.assignments, null, true); - if (init) { - this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); - } - }); - } - - AssignmentExpression(node) { - if (PatternVisitor.isPattern(node.left)) { - if (node.operator === "=") { - this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { - let maybeImplicitGlobal = null; - - if (!this.currentScope().isStrict) { - maybeImplicitGlobal = { - pattern, - node - }; - } - this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); - this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); - }); - } else { - this.currentScope().__referencing(node.left, Reference.RW, node.right); - } - } else { - this.visit(node.left); - } - this.visit(node.right); - } - - CatchClause(node) { - this.scopeManager.__nestCatchScope(node); - - this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { - this.currentScope().__define(pattern, - new Definition( - Variable.CatchClause, - node.param, - node, - null, - null, - null - )); - this.referencingDefaultValue(pattern, info.assignments, null, true); - }); - this.visit(node.body); - - this.close(node); - } - - Program(node) { - this.scopeManager.__nestGlobalScope(node); - - if (this.scopeManager.__isNodejsScope()) { - - // Force strictness of GlobalScope to false when using node.js scope. - this.currentScope().isStrict = false; - this.scopeManager.__nestFunctionScope(node, false); - } - - if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { - this.scopeManager.__nestModuleScope(node); - } - - if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { - this.currentScope().isStrict = true; - } - - this.visitChildren(node); - this.close(node); - } - - Identifier(node) { - this.currentScope().__referencing(node); - } - - UpdateExpression(node) { - if (PatternVisitor.isPattern(node.argument)) { - this.currentScope().__referencing(node.argument, Reference.RW, null); - } else { - this.visitChildren(node); - } - } - - MemberExpression(node) { - this.visit(node.object); - if (node.computed) { - this.visit(node.property); - } - } - - Property(node) { - this.visitProperty(node); - } - - MethodDefinition(node) { - this.visitProperty(node); - } - - BreakStatement() {} // eslint-disable-line class-methods-use-this - - ContinueStatement() {} // eslint-disable-line class-methods-use-this - - LabeledStatement(node) { - this.visit(node.body); - } - - ForStatement(node) { - - // Create ForStatement declaration. - // NOTE: In ES6, ForStatement dynamically generates - // per iteration environment. However, escope is - // a static analyzer, we only generate one scope for ForStatement. - if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { - this.scopeManager.__nestForScope(node); - } - - this.visitChildren(node); - - this.close(node); - } - - ClassExpression(node) { - this.visitClass(node); - } - - ClassDeclaration(node) { - this.visitClass(node); - } - - CallExpression(node) { - - // Check this is direct call to eval - if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { - - // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and - // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. - this.currentScope().variableScope.__detectEval(); - } - this.visitChildren(node); - } - - BlockStatement(node) { - if (this.scopeManager.__isES6()) { - this.scopeManager.__nestBlockScope(node); - } - - this.visitChildren(node); - - this.close(node); - } - - ThisExpression() { - this.currentScope().variableScope.__detectThis(); - } - - WithStatement(node) { - this.visit(node.object); - - // Then nest scope for WithStatement. - this.scopeManager.__nestWithScope(node); - - this.visit(node.body); - - this.close(node); - } - - VariableDeclaration(node) { - const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); - - for (let i = 0, iz = node.declarations.length; i < iz; ++i) { - const decl = node.declarations[i]; - - this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); - if (decl.init) { - this.visit(decl.init); - } - } - } - - // sec 13.11.8 - SwitchStatement(node) { - this.visit(node.discriminant); - - if (this.scopeManager.__isES6()) { - this.scopeManager.__nestSwitchScope(node); - } - - for (let i = 0, iz = node.cases.length; i < iz; ++i) { - this.visit(node.cases[i]); - } - - this.close(node); - } - - FunctionDeclaration(node) { - this.visitFunction(node); - } - - FunctionExpression(node) { - this.visitFunction(node); - } - - ForOfStatement(node) { - this.visitForIn(node); - } - - ForInStatement(node) { - this.visitForIn(node); - } - - ArrowFunctionExpression(node) { - this.visitFunction(node); - } - - ImportDeclaration(node) { - assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); - - const importer = new Importer(node, this); - - importer.visit(node); - } - - visitExportDeclaration(node) { - if (node.source) { - return; - } - if (node.declaration) { - this.visit(node.declaration); - return; - } - - this.visitChildren(node); - } - - // TODO: ExportDeclaration doesn't exist. for bc? - ExportDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportAllDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportDefaultDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportNamedDeclaration(node) { - this.visitExportDeclaration(node); - } - - ExportSpecifier(node) { - - // TODO: `node.id` doesn't exist. for bc? - const local = (node.id || node.local); - - this.visit(local); - } - - MetaProperty() { // eslint-disable-line class-methods-use-this - - // do nothing. - } -} - -module.exports = Referencer; - -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 96988: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -/* eslint-disable no-underscore-dangle */ - -const Scope = __webpack_require__(16313); -const assert = __webpack_require__(39491); - -const GlobalScope = Scope.GlobalScope; -const CatchScope = Scope.CatchScope; -const WithScope = Scope.WithScope; -const ModuleScope = Scope.ModuleScope; -const ClassScope = Scope.ClassScope; -const SwitchScope = Scope.SwitchScope; -const FunctionScope = Scope.FunctionScope; -const ForScope = Scope.ForScope; -const FunctionExpressionNameScope = Scope.FunctionExpressionNameScope; -const BlockScope = Scope.BlockScope; - -/** - * @class ScopeManager - */ -class ScopeManager { - constructor(options) { - this.scopes = []; - this.globalScope = null; - this.__nodeToScope = new WeakMap(); - this.__currentScope = null; - this.__options = options; - this.__declaredVariables = new WeakMap(); - } - - __useDirective() { - return this.__options.directive; - } - - __isOptimistic() { - return this.__options.optimistic; - } - - __ignoreEval() { - return this.__options.ignoreEval; - } - - __isNodejsScope() { - return this.__options.nodejsScope; - } - - isModule() { - return this.__options.sourceType === "module"; - } - - isImpliedStrict() { - return this.__options.impliedStrict; - } - - isStrictModeSupported() { - return this.__options.ecmaVersion >= 5; - } - - // Returns appropriate scope for this node. - __get(node) { - return this.__nodeToScope.get(node); - } - - /** - * Get variables that are declared by the node. - * - * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. - * If the node declares nothing, this method returns an empty array. - * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. - * - * @param {Espree.Node} node - a node to get. - * @returns {Variable[]} variables that declared by the node. - */ - getDeclaredVariables(node) { - return this.__declaredVariables.get(node) || []; - } - - /** - * acquire scope from node. - * @method ScopeManager#acquire - * @param {Espree.Node} node - node for the acquired scope. - * @param {boolean=} inner - look up the most inner scope, default value is false. - * @returns {Scope?} Scope from node - */ - acquire(node, inner) { - - /** - * predicate - * @param {Scope} testScope - scope to test - * @returns {boolean} predicate - */ - function predicate(testScope) { - if (testScope.type === "function" && testScope.functionExpressionScope) { - return false; - } - return true; - } - - const scopes = this.__get(node); - - if (!scopes || scopes.length === 0) { - return null; - } - - // Heuristic selection from all scopes. - // If you would like to get all scopes, please use ScopeManager#acquireAll. - if (scopes.length === 1) { - return scopes[0]; - } - - if (inner) { - for (let i = scopes.length - 1; i >= 0; --i) { - const scope = scopes[i]; - - if (predicate(scope)) { - return scope; - } - } - } else { - for (let i = 0, iz = scopes.length; i < iz; ++i) { - const scope = scopes[i]; - - if (predicate(scope)) { - return scope; - } - } - } - - return null; - } - - /** - * acquire all scopes from node. - * @method ScopeManager#acquireAll - * @param {Espree.Node} node - node for the acquired scope. - * @returns {Scopes?} Scope array - */ - acquireAll(node) { - return this.__get(node); - } - - /** - * release the node. - * @method ScopeManager#release - * @param {Espree.Node} node - releasing node. - * @param {boolean=} inner - look up the most inner scope, default value is false. - * @returns {Scope?} upper scope for the node. - */ - release(node, inner) { - const scopes = this.__get(node); - - if (scopes && scopes.length) { - const scope = scopes[0].upper; - - if (!scope) { - return null; - } - return this.acquire(scope.block, inner); - } - return null; - } - - attach() { } // eslint-disable-line class-methods-use-this - - detach() { } // eslint-disable-line class-methods-use-this - - __nestScope(scope) { - if (scope instanceof GlobalScope) { - assert(this.__currentScope === null); - this.globalScope = scope; - } - this.__currentScope = scope; - return scope; - } - - __nestGlobalScope(node) { - return this.__nestScope(new GlobalScope(this, node)); - } - - __nestBlockScope(node) { - return this.__nestScope(new BlockScope(this, this.__currentScope, node)); - } - - __nestFunctionScope(node, isMethodDefinition) { - return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); - } - - __nestForScope(node) { - return this.__nestScope(new ForScope(this, this.__currentScope, node)); - } - - __nestCatchScope(node) { - return this.__nestScope(new CatchScope(this, this.__currentScope, node)); - } - - __nestWithScope(node) { - return this.__nestScope(new WithScope(this, this.__currentScope, node)); - } - - __nestClassScope(node) { - return this.__nestScope(new ClassScope(this, this.__currentScope, node)); - } - - __nestSwitchScope(node) { - return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); - } - - __nestModuleScope(node) { - return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); - } - - __nestFunctionExpressionNameScope(node) { - return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); - } - - __isES6() { - return this.__options.ecmaVersion >= 6; - } -} - -module.exports = ScopeManager; - -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 16313: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -/* eslint-disable no-underscore-dangle */ -/* eslint-disable no-undefined */ - -const Syntax = (__webpack_require__(18350).Syntax); - -const Reference = __webpack_require__(64945); -const Variable = __webpack_require__(82971); -const Definition = (__webpack_require__(70665).Definition); -const assert = __webpack_require__(39491); - -/** - * Test if scope is struct - * @param {Scope} scope - scope - * @param {Block} block - block - * @param {boolean} isMethodDefinition - is method definition - * @param {boolean} useDirective - use directive - * @returns {boolean} is strict scope - */ -function isStrictScope(scope, block, isMethodDefinition, useDirective) { - let body; - - // When upper scope is exists and strict, inner scope is also strict. - if (scope.upper && scope.upper.isStrict) { - return true; - } - - if (isMethodDefinition) { - return true; - } - - if (scope.type === "class" || scope.type === "module") { - return true; - } - - if (scope.type === "block" || scope.type === "switch") { - return false; - } - - if (scope.type === "function") { - if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) { - return false; - } - - if (block.type === Syntax.Program) { - body = block; - } else { - body = block.body; - } - - if (!body) { - return false; - } - } else if (scope.type === "global") { - body = block; - } else { - return false; - } - - // Search 'use strict' directive. - if (useDirective) { - for (let i = 0, iz = body.body.length; i < iz; ++i) { - const stmt = body.body[i]; - - if (stmt.type !== Syntax.DirectiveStatement) { - break; - } - if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") { - return true; - } - } - } else { - for (let i = 0, iz = body.body.length; i < iz; ++i) { - const stmt = body.body[i]; - - if (stmt.type !== Syntax.ExpressionStatement) { - break; - } - const expr = stmt.expression; - - if (expr.type !== Syntax.Literal || typeof expr.value !== "string") { - break; - } - if (expr.raw !== null && expr.raw !== undefined) { - if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") { - return true; - } - } else { - if (expr.value === "use strict") { - return true; - } - } - } - } - return false; -} - -/** - * Register scope - * @param {ScopeManager} scopeManager - scope manager - * @param {Scope} scope - scope - * @returns {void} - */ -function registerScope(scopeManager, scope) { - scopeManager.scopes.push(scope); - - const scopes = scopeManager.__nodeToScope.get(scope.block); - - if (scopes) { - scopes.push(scope); - } else { - scopeManager.__nodeToScope.set(scope.block, [scope]); - } -} - -/** - * Should be statically - * @param {Object} def - def - * @returns {boolean} should be statically - */ -function shouldBeStatically(def) { - return ( - (def.type === Variable.ClassName) || - (def.type === Variable.Variable && def.parent.kind !== "var") - ); -} - -/** - * @class Scope - */ -class Scope { - constructor(scopeManager, type, upperScope, block, isMethodDefinition) { - - /** - * One of 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'. - * @member {String} Scope#type - */ - this.type = type; - - /** - * The scoped {@link Variable}s of this scope, as { Variable.name - * : Variable }. - * @member {Map} Scope#set - */ - this.set = new Map(); - - /** - * The tainted variables of this scope, as { Variable.name : - * boolean }. - * @member {Map} Scope#taints */ - this.taints = new Map(); - - /** - * Generally, through the lexical scoping of JS you can always know - * which variable an identifier in the source code refers to. There are - * a few exceptions to this rule. With 'global' and 'with' scopes you - * can only decide at runtime which variable a reference refers to. - * Moreover, if 'eval()' is used in a scope, it might introduce new - * bindings in this or its parent scopes. - * All those scopes are considered 'dynamic'. - * @member {boolean} Scope#dynamic - */ - this.dynamic = this.type === "global" || this.type === "with"; - - /** - * A reference to the scope-defining syntax node. - * @member {espree.Node} Scope#block - */ - this.block = block; - - /** - * The {@link Reference|references} that are not resolved with this scope. - * @member {Reference[]} Scope#through - */ - this.through = []; - - /** - * The scoped {@link Variable}s of this scope. In the case of a - * 'function' scope this includes the automatic argument arguments as - * its first element, as well as all further formal arguments. - * @member {Variable[]} Scope#variables - */ - this.variables = []; - - /** - * Any variable {@link Reference|reference} found in this scope. This - * includes occurrences of local variables as well as variables from - * parent scopes (including the global scope). For local variables - * this also includes defining occurrences (like in a 'var' statement). - * In a 'function' scope this does not include the occurrences of the - * formal parameter in the parameter list. - * @member {Reference[]} Scope#references - */ - this.references = []; - - /** - * For 'global' and 'function' scopes, this is a self-reference. For - * other scope types this is the variableScope value of the - * parent scope. - * @member {Scope} Scope#variableScope - */ - this.variableScope = - (this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope; - - /** - * Whether this scope is created by a FunctionExpression. - * @member {boolean} Scope#functionExpressionScope - */ - this.functionExpressionScope = false; - - /** - * Whether this is a scope that contains an 'eval()' invocation. - * @member {boolean} Scope#directCallToEvalScope - */ - this.directCallToEvalScope = false; - - /** - * @member {boolean} Scope#thisFound - */ - this.thisFound = false; - - this.__left = []; - - /** - * Reference to the parent {@link Scope|scope}. - * @member {Scope} Scope#upper - */ - this.upper = upperScope; - - /** - * Whether 'use strict' is in effect in this scope. - * @member {boolean} Scope#isStrict - */ - this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()); - - /** - * List of nested {@link Scope}s. - * @member {Scope[]} Scope#childScopes - */ - this.childScopes = []; - if (this.upper) { - this.upper.childScopes.push(this); - } - - this.__declaredVariables = scopeManager.__declaredVariables; - - registerScope(scopeManager, this); - } - - __shouldStaticallyClose(scopeManager) { - return (!this.dynamic || scopeManager.__isOptimistic()); - } - - __shouldStaticallyCloseForGlobal(ref) { - - // On global scope, let/const/class declarations should be resolved statically. - const name = ref.identifier.name; - - if (!this.set.has(name)) { - return false; - } - - const variable = this.set.get(name); - const defs = variable.defs; - - return defs.length > 0 && defs.every(shouldBeStatically); - } - - __staticCloseRef(ref) { - if (!this.__resolve(ref)) { - this.__delegateToUpperScope(ref); - } - } - - __dynamicCloseRef(ref) { - - // notify all names are through to global - let current = this; - - do { - current.through.push(ref); - current = current.upper; - } while (current); - } - - __globalCloseRef(ref) { - - // let/const/class declarations should be resolved statically. - // others should be resolved dynamically. - if (this.__shouldStaticallyCloseForGlobal(ref)) { - this.__staticCloseRef(ref); - } else { - this.__dynamicCloseRef(ref); - } - } - - __close(scopeManager) { - let closeRef; - - if (this.__shouldStaticallyClose(scopeManager)) { - closeRef = this.__staticCloseRef; - } else if (this.type !== "global") { - closeRef = this.__dynamicCloseRef; - } else { - closeRef = this.__globalCloseRef; - } - - // Try Resolving all references in this scope. - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - closeRef.call(this, ref); - } - this.__left = null; - - return this.upper; - } - - // To override by function scopes. - // References in default parameters isn't resolved to variables which are in their function body. - __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars - return true; - } - - __resolve(ref) { - const name = ref.identifier.name; - - if (!this.set.has(name)) { - return false; - } - const variable = this.set.get(name); - - if (!this.__isValidResolution(ref, variable)) { - return false; - } - variable.references.push(ref); - variable.stack = variable.stack && ref.from.variableScope === this.variableScope; - if (ref.tainted) { - variable.tainted = true; - this.taints.set(variable.name, true); - } - ref.resolved = variable; - - return true; - } - - __delegateToUpperScope(ref) { - if (this.upper) { - this.upper.__left.push(ref); - } - this.through.push(ref); - } - - __addDeclaredVariablesOfNode(variable, node) { - if (node === null || node === undefined) { - return; - } - - let variables = this.__declaredVariables.get(node); - - if (variables === null || variables === undefined) { - variables = []; - this.__declaredVariables.set(node, variables); - } - if (variables.indexOf(variable) === -1) { - variables.push(variable); - } - } - - __defineGeneric(name, set, variables, node, def) { - let variable; - - variable = set.get(name); - if (!variable) { - variable = new Variable(name, this); - set.set(name, variable); - variables.push(variable); - } - - if (def) { - variable.defs.push(def); - this.__addDeclaredVariablesOfNode(variable, def.node); - this.__addDeclaredVariablesOfNode(variable, def.parent); - } - if (node) { - variable.identifiers.push(node); - } - } - - __define(node, def) { - if (node && node.type === Syntax.Identifier) { - this.__defineGeneric( - node.name, - this.set, - this.variables, - node, - def - ); - } - } - - __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { - - // because Array element may be null - if (!node || node.type !== Syntax.Identifier) { - return; - } - - // Specially handle like `this`. - if (node.name === "super") { - return; - } - - const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); - - this.references.push(ref); - this.__left.push(ref); - } - - __detectEval() { - let current = this; - - this.directCallToEvalScope = true; - do { - current.dynamic = true; - current = current.upper; - } while (current); - } - - __detectThis() { - this.thisFound = true; - } - - __isClosed() { - return this.__left === null; - } - - /** - * returns resolved {Reference} - * @method Scope#resolve - * @param {Espree.Identifier} ident - identifier to be resolved. - * @returns {Reference} reference - */ - resolve(ident) { - let ref, i, iz; - - assert(this.__isClosed(), "Scope should be closed."); - assert(ident.type === Syntax.Identifier, "Target should be identifier."); - for (i = 0, iz = this.references.length; i < iz; ++i) { - ref = this.references[i]; - if (ref.identifier === ident) { - return ref; - } - } - return null; - } - - /** - * returns this scope is static - * @method Scope#isStatic - * @returns {boolean} static - */ - isStatic() { - return !this.dynamic; - } - - /** - * returns this scope has materialized arguments - * @method Scope#isArgumentsMaterialized - * @returns {boolean} arguemnts materialized - */ - isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this - return true; - } - - /** - * returns this scope has materialized `this` reference - * @method Scope#isThisMaterialized - * @returns {boolean} this materialized - */ - isThisMaterialized() { // eslint-disable-line class-methods-use-this - return true; - } - - isUsedName(name) { - if (this.set.has(name)) { - return true; - } - for (let i = 0, iz = this.through.length; i < iz; ++i) { - if (this.through[i].identifier.name === name) { - return true; - } - } - return false; - } -} - -class GlobalScope extends Scope { - constructor(scopeManager, block) { - super(scopeManager, "global", null, block, false); - this.implicit = { - set: new Map(), - variables: [], - - /** - * List of {@link Reference}s that are left to be resolved (i.e. which - * need to be linked to the variable they refer to). - * @member {Reference[]} Scope#implicit#left - */ - left: [] - }; - } - - __close(scopeManager) { - const implicit = []; - - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { - implicit.push(ref.__maybeImplicitGlobal); - } - } - - // create an implicit global variable from assignment expression - for (let i = 0, iz = implicit.length; i < iz; ++i) { - const info = implicit[i]; - - this.__defineImplicit(info.pattern, - new Definition( - Variable.ImplicitGlobalVariable, - info.pattern, - info.node, - null, - null, - null - )); - - } - - this.implicit.left = this.__left; - - return super.__close(scopeManager); - } - - __defineImplicit(node, def) { - if (node && node.type === Syntax.Identifier) { - this.__defineGeneric( - node.name, - this.implicit.set, - this.implicit.variables, - node, - def - ); - } - } -} - -class ModuleScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "module", upperScope, block, false); - } -} - -class FunctionExpressionNameScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "function-expression-name", upperScope, block, false); - this.__define(block.id, - new Definition( - Variable.FunctionName, - block.id, - block, - null, - null, - null - )); - this.functionExpressionScope = true; - } -} - -class CatchScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "catch", upperScope, block, false); - } -} - -class WithScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "with", upperScope, block, false); - } - - __close(scopeManager) { - if (this.__shouldStaticallyClose(scopeManager)) { - return super.__close(scopeManager); - } - - for (let i = 0, iz = this.__left.length; i < iz; ++i) { - const ref = this.__left[i]; - - ref.tainted = true; - this.__delegateToUpperScope(ref); - } - this.__left = null; - - return this.upper; - } -} - -class BlockScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "block", upperScope, block, false); - } -} - -class SwitchScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "switch", upperScope, block, false); - } -} - -class FunctionScope extends Scope { - constructor(scopeManager, upperScope, block, isMethodDefinition) { - super(scopeManager, "function", upperScope, block, isMethodDefinition); - - // section 9.2.13, FunctionDeclarationInstantiation. - // NOTE Arrow functions never have an arguments objects. - if (this.block.type !== Syntax.ArrowFunctionExpression) { - this.__defineArguments(); - } - } - - isArgumentsMaterialized() { - - // TODO(Constellation) - // We can more aggressive on this condition like this. - // - // function t() { - // // arguments of t is always hidden. - // function arguments() { - // } - // } - if (this.block.type === Syntax.ArrowFunctionExpression) { - return false; - } - - if (!this.isStatic()) { - return true; - } - - const variable = this.set.get("arguments"); - - assert(variable, "Always have arguments variable."); - return variable.tainted || variable.references.length !== 0; - } - - isThisMaterialized() { - if (!this.isStatic()) { - return true; - } - return this.thisFound; - } - - __defineArguments() { - this.__defineGeneric( - "arguments", - this.set, - this.variables, - null, - null - ); - this.taints.set("arguments", true); - } - - // References in default parameters isn't resolved to variables which are in their function body. - // const x = 1 - // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. - // const x = 2 - // console.log(a) - // } - __isValidResolution(ref, variable) { - - // If `options.nodejsScope` is true, `this.block` becomes a Program node. - if (this.block.type === "Program") { - return true; - } - - const bodyStart = this.block.body.range[0]; - - // It's invalid resolution in the following case: - return !( - variable.scope === this && - ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. - variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. - ); - } -} - -class ForScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "for", upperScope, block, false); - } -} - -class ClassScope extends Scope { - constructor(scopeManager, upperScope, block) { - super(scopeManager, "class", upperScope, block, false); - } -} - -module.exports = { - Scope, - GlobalScope, - ModuleScope, - FunctionExpressionNameScope, - CatchScope, - WithScope, - BlockScope, - SwitchScope, - FunctionScope, - ForScope, - ClassScope -}; - -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 82971: -/***/ (function(module) { - -"use strict"; -/* - Copyright (C) 2015 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -/** - * A Variable represents a locally scoped identifier. These include arguments to - * functions. - * @class Variable - */ -class Variable { - constructor(name, scope) { - - /** - * The variable name, as given in the source code. - * @member {String} Variable#name - */ - this.name = name; - - /** - * List of defining occurrences of this variable (like in 'var ...' - * statements or as parameter), as AST nodes. - * @member {espree.Identifier[]} Variable#identifiers - */ - this.identifiers = []; - - /** - * List of {@link Reference|references} of this variable (excluding parameter entries) - * in its defining scope and all nested scopes. For defining - * occurrences only see {@link Variable#defs}. - * @member {Reference[]} Variable#references - */ - this.references = []; - - /** - * List of defining occurrences of this variable (like in 'var ...' - * statements or as parameter), as custom objects. - * @member {Definition[]} Variable#defs - */ - this.defs = []; - - this.tainted = false; - - /** - * Whether this is a stack variable. - * @member {boolean} Variable#stack - */ - this.stack = true; - - /** - * Reference to the enclosing Scope. - * @member {Scope} Variable#scope - */ - this.scope = scope; - } -} - -Variable.CatchClause = "CatchClause"; -Variable.Parameter = "Parameter"; -Variable.FunctionName = "FunctionName"; -Variable.ClassName = "ClassName"; -Variable.Variable = "Variable"; -Variable.ImportBinding = "ImportBinding"; -Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; - -module.exports = Variable; - -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 81217: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -(function () { - 'use strict'; - - var estraverse = __webpack_require__(50165); - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; - } - - function Visitor(visitor, options) { - options = options || {}; - - this.__visitor = visitor || this; - this.__childVisitorKeys = options.childVisitorKeys - ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) - : estraverse.VisitorKeys; - if (options.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof options.fallback === 'function') { - this.__fallback = options.fallback; - } - } - - /* Default method for visiting children. - * When you need to call default visiting operation inside custom visiting - * operation, you can use it with `this.visitChildren(node)`. - */ - Visitor.prototype.visitChildren = function (node) { - var type, children, i, iz, j, jz, child; - - if (node == null) { - return; - } - - type = node.type || estraverse.Syntax.Property; - - children = this.__childVisitorKeys[type]; - if (!children) { - if (this.__fallback) { - children = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + type + '.'); - } - } - - for (i = 0, iz = children.length; i < iz; ++i) { - child = node[children[i]]; - if (child) { - if (Array.isArray(child)) { - for (j = 0, jz = child.length; j < jz; ++j) { - if (child[j]) { - if (isNode(child[j]) || isProperty(type, children[i])) { - this.visit(child[j]); - } - } - } - } else if (isNode(child)) { - this.visit(child); - } - } - } - }; - - /* Dispatching node. */ - Visitor.prototype.visit = function (node) { - var type; - - if (node == null) { - return; - } - - type = node.type || estraverse.Syntax.Property; - if (this.__visitor[type]) { - this.__visitor[type].call(this, node); - return; - } - this.visitChildren(node); - }; - - exports.version = __webpack_require__(12166).version; - exports.Visitor = Visitor; - exports.visit = function (node, visitor, options) { - var v = new Visitor(visitor, options); - v.visit(node); - }; -}()); -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 50165: -/***/ (function(__unused_webpack_module, exports) { - -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*jslint vars:false, bitwise:true*/ -/*jshint indent:4*/ -/*global exports:true*/ -(function clone(exports) { - 'use strict'; - - var Syntax, - VisitorOption, - VisitorKeys, - BREAK, - SKIP, - REMOVE; - - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === 'object' && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - - // based on LLVM libc++ upper_bound / lower_bound - // MIT License - - function upperBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - len = diff; - } else { - i = current + 1; - len -= diff + 1; - } - } - return i; - } - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ChainExpression: 'ChainExpression', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. - ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - DirectiveStatement: 'DirectiveStatement', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportExpression: 'ImportExpression', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - ModuleSpecifier: 'ModuleSpecifier', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - VisitorKeys = { - AssignmentExpression: ['left', 'right'], - AssignmentPattern: ['left', 'right'], - ArrayExpression: ['elements'], - ArrayPattern: ['elements'], - ArrowFunctionExpression: ['params', 'body'], - AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. - BlockStatement: ['body'], - BinaryExpression: ['left', 'right'], - BreakStatement: ['label'], - CallExpression: ['callee', 'arguments'], - CatchClause: ['param', 'body'], - ChainExpression: ['expression'], - ClassBody: ['body'], - ClassDeclaration: ['id', 'superClass', 'body'], - ClassExpression: ['id', 'superClass', 'body'], - ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. - ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - ConditionalExpression: ['test', 'consequent', 'alternate'], - ContinueStatement: ['label'], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ['body', 'test'], - EmptyStatement: [], - ExportAllDeclaration: ['source'], - ExportDefaultDeclaration: ['declaration'], - ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], - ExportSpecifier: ['exported', 'local'], - ExpressionStatement: ['expression'], - ForStatement: ['init', 'test', 'update', 'body'], - ForInStatement: ['left', 'right', 'body'], - ForOfStatement: ['left', 'right', 'body'], - FunctionDeclaration: ['id', 'params', 'body'], - FunctionExpression: ['id', 'params', 'body'], - GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - Identifier: [], - IfStatement: ['test', 'consequent', 'alternate'], - ImportExpression: ['source'], - ImportDeclaration: ['specifiers', 'source'], - ImportDefaultSpecifier: ['local'], - ImportNamespaceSpecifier: ['local'], - ImportSpecifier: ['imported', 'local'], - Literal: [], - LabeledStatement: ['label', 'body'], - LogicalExpression: ['left', 'right'], - MemberExpression: ['object', 'property'], - MetaProperty: ['meta', 'property'], - MethodDefinition: ['key', 'value'], - ModuleSpecifier: [], - NewExpression: ['callee', 'arguments'], - ObjectExpression: ['properties'], - ObjectPattern: ['properties'], - Program: ['body'], - Property: ['key', 'value'], - RestElement: [ 'argument' ], - ReturnStatement: ['argument'], - SequenceExpression: ['expressions'], - SpreadElement: ['argument'], - Super: [], - SwitchStatement: ['discriminant', 'cases'], - SwitchCase: ['test', 'consequent'], - TaggedTemplateExpression: ['tag', 'quasi'], - TemplateElement: [], - TemplateLiteral: ['quasis', 'expressions'], - ThisExpression: [], - ThrowStatement: ['argument'], - TryStatement: ['block', 'handler', 'finalizer'], - UnaryExpression: ['argument'], - UpdateExpression: ['argument'], - VariableDeclaration: ['declarations'], - VariableDeclarator: ['id', 'init'], - WhileStatement: ['test', 'body'], - WithStatement: ['object', 'body'], - YieldExpression: ['argument'] - }; - - // unique id - BREAK = {}; - SKIP = {}; - REMOVE = {}; - - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - - Reference.prototype.replace = function replace(node) { - this.parent[this.key] = node; - }; - - Reference.prototype.remove = function remove() { - if (Array.isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - - function Controller() { } - - // API: - // return property path array from root to current node - Controller.prototype.path = function path() { - var i, iz, j, jz, result, element; - - function addToPath(result, path) { - if (Array.isArray(path)) { - for (j = 0, jz = path.length; j < jz; ++j) { - result.push(path[j]); - } - } else { - result.push(path); - } - } - - // root node - if (!this.__current.path) { - return null; - } - - // first node is sentinel, second node is root element - result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { - element = this.__leavelist[i]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - - // API: - // return type of current node - Controller.prototype.type = function () { - var node = this.current(); - return node.type || this.__current.wrap; - }; - - // API: - // return array of parent elements - Controller.prototype.parents = function parents() { - var i, iz, result; - - // first node is sentinel - result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { - result.push(this.__leavelist[i].node); - } - - return result; - }; - - // API: - // return current node - Controller.prototype.current = function current() { - return this.__current.node; - }; - - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - - result = undefined; - - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - - return result; - }; - - // API: - // notify control skip / break - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - - // API: - // skip child nodes of current node - Controller.prototype.skip = function () { - this.notify(SKIP); - }; - - // API: - // break traversals - Controller.prototype['break'] = function () { - this.notify(BREAK); - }; - - // API: - // remove node - Controller.prototype.remove = function () { - this.notify(REMOVE); - }; - - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof visitor.fallback === 'function') { - this.__fallback = visitor.fallback; - } - - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); - } - }; - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; - } - - function candidateExistsInLeaveList(leavelist, candidate) { - for (var i = leavelist.length - 1; i >= 0; --i) { - if (leavelist[i].node === candidate) { - return true; - } - } - return false; - } - - Controller.prototype.traverse = function traverse(root, visitor) { - var worklist, - leavelist, - element, - node, - nodeType, - ret, - key, - current, - current2, - candidates, - candidate, - sentinel; - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - ret = this.__execute(visitor.leave, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - - if (element.node) { - - ret = this.__execute(visitor.enter, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || ret === SKIP) { - continue; - } - - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - - if (candidateExistsInLeaveList(leavelist, candidate[current2])) { - continue; - } - - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - if (candidateExistsInLeaveList(leavelist, candidate)) { - continue; - } - - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - - Controller.prototype.replace = function replace(root, visitor) { - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - - function removeElem(element) { - var i, - key, - nextElem, - parent; - - if (element.ref.remove()) { - // When the reference is an element of an array. - key = element.ref.key; - parent = element.ref.parent; - - // If removed from array, then decrease following items' keys. - i = worklist.length; - while (i--) { - nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key) { - break; - } - --nextElem.ref.key; - } - } - } - } - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - outer = { - root: root - }; - element = new Element(root, null, null, new Reference(outer, 'root')); - worklist.push(element); - leavelist.push(element); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - target = this.__execute(visitor.leave, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - - target = this.__execute(visitor.enter, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - element.node = target; - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - - // node may be null - node = element.node; - if (!node) { - continue; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || target === SKIP) { - continue; - } - - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - - return outer.root; - }; - - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - - function extendCommentRange(comment, tokens) { - var target; - - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - - comment.extendedRange = [comment.range[0], comment.range[1]]; - - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - - return comment; - } - - function attachComments(tree, providedComments, tokens) { - // At first, we should calculate extended comment ranges. - var comments = [], comment, len, i, cursor; - - if (!tree.range) { - throw new Error('attachComments needs range information'); - } - - // tokens array is empty, we attach comments to tree as 'leadingComments' - if (!tokens.length) { - if (providedComments.length) { - for (i = 0, len = providedComments.length; i < len; i += 1) { - comment = deepCopy(providedComments[i]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - - for (i = 0, len = providedComments.length; i < len; i += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } - - // This is based on John Freeman's implementation. - cursor = 0; - traverse(tree, { - enter: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { - break; - } - - if (comment.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - cursor = 0; - traverse(tree, { - leave: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { - break; - } - - if (node.range[1] === comment.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - return tree; - } - - exports.Syntax = Syntax; - exports.traverse = traverse; - exports.replace = replace; - exports.attachComments = attachComments; - exports.VisitorKeys = VisitorKeys; - exports.VisitorOption = VisitorOption; - exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - - return exports; -}(exports)); -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 18350: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*jslint vars:false, bitwise:true*/ -/*jshint indent:4*/ -/*global exports:true*/ -(function clone(exports) { - 'use strict'; - - var Syntax, - VisitorOption, - VisitorKeys, - BREAK, - SKIP, - REMOVE; - - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === 'object' && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - - // based on LLVM libc++ upper_bound / lower_bound - // MIT License - - function upperBound(array, func) { - var diff, len, i, current; - - len = array.length; - i = 0; - - while (len) { - diff = len >>> 1; - current = i + diff; - if (func(array[current])) { - len = diff; - } else { - i = current + 1; - len -= diff + 1; - } - } - return i; - } - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. - ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - DirectiveStatement: 'DirectiveStatement', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportExpression: 'ImportExpression', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - ModuleSpecifier: 'ModuleSpecifier', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - VisitorKeys = { - AssignmentExpression: ['left', 'right'], - AssignmentPattern: ['left', 'right'], - ArrayExpression: ['elements'], - ArrayPattern: ['elements'], - ArrowFunctionExpression: ['params', 'body'], - AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. - BlockStatement: ['body'], - BinaryExpression: ['left', 'right'], - BreakStatement: ['label'], - CallExpression: ['callee', 'arguments'], - CatchClause: ['param', 'body'], - ClassBody: ['body'], - ClassDeclaration: ['id', 'superClass', 'body'], - ClassExpression: ['id', 'superClass', 'body'], - ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. - ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - ConditionalExpression: ['test', 'consequent', 'alternate'], - ContinueStatement: ['label'], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ['body', 'test'], - EmptyStatement: [], - ExportAllDeclaration: ['source'], - ExportDefaultDeclaration: ['declaration'], - ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], - ExportSpecifier: ['exported', 'local'], - ExpressionStatement: ['expression'], - ForStatement: ['init', 'test', 'update', 'body'], - ForInStatement: ['left', 'right', 'body'], - ForOfStatement: ['left', 'right', 'body'], - FunctionDeclaration: ['id', 'params', 'body'], - FunctionExpression: ['id', 'params', 'body'], - GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. - Identifier: [], - IfStatement: ['test', 'consequent', 'alternate'], - ImportExpression: ['source'], - ImportDeclaration: ['specifiers', 'source'], - ImportDefaultSpecifier: ['local'], - ImportNamespaceSpecifier: ['local'], - ImportSpecifier: ['imported', 'local'], - Literal: [], - LabeledStatement: ['label', 'body'], - LogicalExpression: ['left', 'right'], - MemberExpression: ['object', 'property'], - MetaProperty: ['meta', 'property'], - MethodDefinition: ['key', 'value'], - ModuleSpecifier: [], - NewExpression: ['callee', 'arguments'], - ObjectExpression: ['properties'], - ObjectPattern: ['properties'], - Program: ['body'], - Property: ['key', 'value'], - RestElement: [ 'argument' ], - ReturnStatement: ['argument'], - SequenceExpression: ['expressions'], - SpreadElement: ['argument'], - Super: [], - SwitchStatement: ['discriminant', 'cases'], - SwitchCase: ['test', 'consequent'], - TaggedTemplateExpression: ['tag', 'quasi'], - TemplateElement: [], - TemplateLiteral: ['quasis', 'expressions'], - ThisExpression: [], - ThrowStatement: ['argument'], - TryStatement: ['block', 'handler', 'finalizer'], - UnaryExpression: ['argument'], - UpdateExpression: ['argument'], - VariableDeclaration: ['declarations'], - VariableDeclarator: ['id', 'init'], - WhileStatement: ['test', 'body'], - WithStatement: ['object', 'body'], - YieldExpression: ['argument'] - }; - - // unique id - BREAK = {}; - SKIP = {}; - REMOVE = {}; - - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - - Reference.prototype.replace = function replace(node) { - this.parent[this.key] = node; - }; - - Reference.prototype.remove = function remove() { - if (Array.isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - - function Controller() { } - - // API: - // return property path array from root to current node - Controller.prototype.path = function path() { - var i, iz, j, jz, result, element; - - function addToPath(result, path) { - if (Array.isArray(path)) { - for (j = 0, jz = path.length; j < jz; ++j) { - result.push(path[j]); - } - } else { - result.push(path); - } - } - - // root node - if (!this.__current.path) { - return null; - } - - // first node is sentinel, second node is root element - result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { - element = this.__leavelist[i]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - - // API: - // return type of current node - Controller.prototype.type = function () { - var node = this.current(); - return node.type || this.__current.wrap; - }; - - // API: - // return array of parent elements - Controller.prototype.parents = function parents() { - var i, iz, result; - - // first node is sentinel - result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { - result.push(this.__leavelist[i].node); - } - - return result; - }; - - // API: - // return current node - Controller.prototype.current = function current() { - return this.__current.node; - }; - - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - - result = undefined; - - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - - return result; - }; - - // API: - // notify control skip / break - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - - // API: - // skip child nodes of current node - Controller.prototype.skip = function () { - this.notify(SKIP); - }; - - // API: - // break traversals - Controller.prototype['break'] = function () { - this.notify(BREAK); - }; - - // API: - // remove node - Controller.prototype.remove = function () { - this.notify(REMOVE); - }; - - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === 'iteration') { - this.__fallback = Object.keys; - } else if (typeof visitor.fallback === 'function') { - this.__fallback = visitor.fallback; - } - - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); - } - }; - - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === 'object' && typeof node.type === 'string'; - } - - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; - } - - Controller.prototype.traverse = function traverse(root, visitor) { - var worklist, - leavelist, - element, - node, - nodeType, - ret, - key, - current, - current2, - candidates, - candidate, - sentinel; - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - ret = this.__execute(visitor.leave, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - - if (element.node) { - - ret = this.__execute(visitor.enter, element); - - if (this.__state === BREAK || ret === BREAK) { - return; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || ret === SKIP) { - continue; - } - - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - - Controller.prototype.replace = function replace(root, visitor) { - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - - function removeElem(element) { - var i, - key, - nextElem, - parent; - - if (element.ref.remove()) { - // When the reference is an element of an array. - key = element.ref.key; - parent = element.ref.parent; - - // If removed from array, then decrease following items' keys. - i = worklist.length; - while (i--) { - nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key) { - break; - } - --nextElem.ref.key; - } - } - } - } - - this.__initialize(root, visitor); - - sentinel = {}; - - // reference - worklist = this.__worklist; - leavelist = this.__leavelist; - - // initialize - outer = { - root: root - }; - element = new Element(root, null, null, new Reference(outer, 'root')); - worklist.push(element); - leavelist.push(element); - - while (worklist.length) { - element = worklist.pop(); - - if (element === sentinel) { - element = leavelist.pop(); - - target = this.__execute(visitor.leave, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - - target = this.__execute(visitor.enter, element); - - // node may be replaced with null, - // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { - // replace - element.ref.replace(target); - element.node = target; - } - - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - - // node may be null - node = element.node; - if (!node) { - continue; - } - - worklist.push(sentinel); - leavelist.push(element); - - if (this.__state === SKIP || target === SKIP) { - continue; - } - - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error('Unknown node type ' + nodeType + '.'); - } - } - - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - - return outer.root; - }; - - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - - function extendCommentRange(comment, tokens) { - var target; - - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - - comment.extendedRange = [comment.range[0], comment.range[1]]; - - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - - return comment; - } - - function attachComments(tree, providedComments, tokens) { - // At first, we should calculate extended comment ranges. - var comments = [], comment, len, i, cursor; - - if (!tree.range) { - throw new Error('attachComments needs range information'); - } - - // tokens array is empty, we attach comments to tree as 'leadingComments' - if (!tokens.length) { - if (providedComments.length) { - for (i = 0, len = providedComments.length; i < len; i += 1) { - comment = deepCopy(providedComments[i]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - - for (i = 0, len = providedComments.length; i < len; i += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } - - // This is based on John Freeman's implementation. - cursor = 0; - traverse(tree, { - enter: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { - break; - } - - if (comment.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - cursor = 0; - traverse(tree, { - leave: function (node) { - var comment; - - while (cursor < comments.length) { - comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { - break; - } - - if (node.range[1] === comment.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - - // already out of owned node - if (cursor === comments.length) { - return VisitorOption.Break; - } - - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - - return tree; - } - - exports.version = (__webpack_require__(15535)/* .version */ .i8); - exports.Syntax = Syntax; - exports.traverse = traverse; - exports.replace = replace; - exports.attachComments = attachComments; - exports.VisitorKeys = VisitorKeys; - exports.VisitorOption = VisitorOption; - exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - - return exports; -}(exports)); -/* vim: set sw=4 ts=4 et tw=80 : */ - - -/***/ }), - -/***/ 86140: -/***/ (function(module) { - -module.exports = function (glob, opts) { - if (typeof glob !== 'string') { - throw new TypeError('Expected a string'); - } - - var str = String(glob); - - // The regexp we are building, as a string. - var reStr = ""; - - // Whether we are matching so called "extended" globs (like bash) and should - // support single character matching, matching ranges of characters, group - // matching, etc. - var extended = opts ? !!opts.extended : false; - - // When globstar is _false_ (default), '/foo/*' is translated a regexp like - // '^\/foo\/.*$' which will match any string beginning with '/foo/' - // When globstar is _true_, '/foo/*' is translated to regexp like - // '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT - // which does not have a '/' to the right of it. - // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but - // these will not '/foo/bar/baz', '/foo/bar/baz.txt' - // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when - // globstar is _false_ - var globstar = opts ? !!opts.globstar : false; - - // If we are doing extended matching, this boolean is true when we are inside - // a group (eg {*.html,*.js}), and false otherwise. - var inGroup = false; - - // RegExp flags (eg "i" ) to pass in to RegExp constructor. - var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : ""; - - var c; - for (var i = 0, len = str.length; i < len; i++) { - c = str[i]; - - switch (c) { - case "/": - case "$": - case "^": - case "+": - case ".": - case "(": - case ")": - case "=": - case "!": - case "|": - reStr += "\\" + c; - break; - - case "?": - if (extended) { - reStr += "."; - break; - } - - case "[": - case "]": - if (extended) { - reStr += c; - break; - } - - case "{": - if (extended) { - inGroup = true; - reStr += "("; - break; - } - - case "}": - if (extended) { - inGroup = false; - reStr += ")"; - break; - } - - case ",": - if (inGroup) { - reStr += "|"; - break; - } - reStr += "\\" + c; - break; - - case "*": - // Move over all consecutive "*"'s. - // Also store the previous and next characters - var prevChar = str[i - 1]; - var starCount = 1; - while(str[i + 1] === "*") { - starCount++; - i++; - } - var nextChar = str[i + 1]; - - if (!globstar) { - // globstar is disabled, so treat any number of "*" as one - reStr += ".*"; - } else { - // globstar is enabled, so determine if this is a globstar segment - var isGlobstar = starCount > 1 // multiple "*"'s - && (prevChar === "/" || prevChar === undefined) // from the start of the segment - && (nextChar === "/" || nextChar === undefined) // to the end of the segment - - if (isGlobstar) { - // it's a globstar, so match zero or more path segments - reStr += "((?:[^/]*(?:\/|$))*)"; - i++; // move over the "/" - } else { - // it's not a globstar, so only match one path segment - reStr += "([^/]*)"; - } - } - break; - - default: - reStr += c; - } - } - - // When regexp 'g' flag is specified don't - // constrain the regular expression with ^ & $ - if (!flags || !~flags.indexOf('g')) { - reStr = "^" + reStr + "$"; - } - - return new RegExp(reStr, flags); -}; - - -/***/ }), - -/***/ 89132: -/***/ (function(module) { - -"use strict"; - - -module.exports = clone - -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj - - if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } - else - var copy = Object.create(null) - - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) - - return copy -} - - -/***/ }), - -/***/ 90552: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -var fs = __webpack_require__(57147) -var polyfills = __webpack_require__(11290) -var legacy = __webpack_require__(54410) -var clone = __webpack_require__(89132) - -var util = __webpack_require__(73837) - -/* istanbul ignore next - node 0.x polyfill */ -var gracefulQueue -var previousSymbol - -/* istanbul ignore else - node 0.x polyfill */ -if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { - gracefulQueue = Symbol.for('graceful-fs.queue') - // This is used in testing by future versions - previousSymbol = Symbol.for('graceful-fs.previous') -} else { - gracefulQueue = '___graceful-fs.queue' - previousSymbol = '___graceful-fs.previous' -} - -function noop () {} - -function publishQueue(context, queue) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue - } - }) -} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) - } - -// Once time initialization -if (!fs[gracefulQueue]) { - // This queue can be shared by multiple loaded instances - var queue = global[gracefulQueue] || [] - publishQueue(fs, queue) - - // Patch fs.close/closeSync to shared queue version, because we need - // to retry() whenever a close happens *anywhere* in the program. - // This is essential when multiple graceful-fs instances are - // in play at the same time. - fs.close = (function (fs$close) { - function close (fd, cb) { - return fs$close.call(fs, fd, function (err) { - // This function uses the graceful-fs shared queue - if (!err) { - retry() - } - - if (typeof cb === 'function') - cb.apply(this, arguments) - }) - } - - Object.defineProperty(close, previousSymbol, { - value: fs$close - }) - return close - })(fs.close) - - fs.closeSync = (function (fs$closeSync) { - function closeSync (fd) { - // This function uses the graceful-fs shared queue - fs$closeSync.apply(fs, arguments) - retry() - } - - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }) - return closeSync - })(fs.closeSync) - - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(fs[gracefulQueue]) - __webpack_require__(39491).equal(fs[gracefulQueue].length, 0) - }) - } -} - -if (!global[gracefulQueue]) { - publishQueue(global, fs[gracefulQueue]); -} - -module.exports = patch(clone(fs)) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { - module.exports = patch(fs) - fs.__patched = true; -} - -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch - - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$readFile(path, options, cb) - - function go$readFile (path, options, cb) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$writeFile(path, data, options, cb) - - function go$writeFile (path, data, options, cb) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$appendFile(path, data, options, cb) - - function go$appendFile (path, data, options, cb) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$readdir = fs.readdir - fs.readdir = readdir - function readdir (path, options, cb) { - var args = [path] - if (typeof options !== 'function') { - args.push(options) - } else { - cb = options - } - args.push(go$readdir$cb) - - return go$readdir(args) - - function go$readdir$cb (err, files) { - if (files && files.sort) - files.sort() - - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readdir, [args]]) - - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - } - } - - function go$readdir (args) { - return fs$readdir.apply(fs, args) - } - - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } - - var fs$ReadStream = fs.ReadStream - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - } - - var fs$WriteStream = fs.WriteStream - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open - } - - Object.defineProperty(fs, 'ReadStream', { - get: function () { - return ReadStream - }, - set: function (val) { - ReadStream = val - }, - enumerable: true, - configurable: true - }) - Object.defineProperty(fs, 'WriteStream', { - get: function () { - return WriteStream - }, - set: function (val) { - WriteStream = val - }, - enumerable: true, - configurable: true - }) - - // legacy names - var FileReadStream = ReadStream - Object.defineProperty(fs, 'FileReadStream', { - get: function () { - return FileReadStream - }, - set: function (val) { - FileReadStream = val - }, - enumerable: true, - configurable: true - }) - var FileWriteStream = WriteStream - Object.defineProperty(fs, 'FileWriteStream', { - get: function () { - return FileWriteStream - }, - set: function (val) { - FileWriteStream = val - }, - enumerable: true, - configurable: true - }) - - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) - } - - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() - - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } - - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) - } - - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } - - function createReadStream (path, options) { - return new fs.ReadStream(path, options) - } - - function createWriteStream (path, options) { - return new fs.WriteStream(path, options) - } - - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null - - return go$open(path, flags, mode, cb) - - function go$open (path, flags, mode, cb) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - return fs -} - -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - fs[gracefulQueue].push(elem) -} - -function retry () { - var elem = fs[gracefulQueue].shift() - if (elem) { - debug('RETRY', elem[0].name, elem[1]) - elem[0].apply(null, elem[1]) - } -} - - -/***/ }), - -/***/ 54410: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -var Stream = (__webpack_require__(12781).Stream) - -module.exports = legacy - -function legacy (fs) { - return { - ReadStream: ReadStream, - WriteStream: WriteStream - } - - function ReadStream (path, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path, options); - - Stream.call(this); - - var self = this; - - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; - - this.flags = 'r'; - this.mode = 438; /*=0666*/ - this.bufferSize = 64 * 1024; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.encoding) this.setEncoding(this.encoding); - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } - - fs.open(this.path, this.flags, this.mode, function (err, fd) { - if (err) { - self.emit('error', err); - self.readable = false; - return; - } - - self.fd = fd; - self.emit('open', fd); - self._read(); - }) - } - - function WriteStream (path, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path, options); - - Stream.call(this); - - this.path = path; - this.fd = null; - this.writable = true; - - this.flags = 'w'; - this.encoding = 'binary'; - this.mode = 438; /*=0666*/ - this.bytesWritten = 0; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - this.busy = false; - this._queue = []; - - if (this.fd === null) { - this._open = fs.open; - this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); - this.flush(); - } - } -} - - -/***/ }), - -/***/ 11290: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -var constants = __webpack_require__(22057) - -var origCwd = process.cwd -var cwd = null - -var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform - -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -try { - process.cwd() -} catch (er) {} - -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -module.exports = patch - -function patch (fs) { - // (re-)implement some things that are known busted or missing. - - // lchmod, broken prior to 0.6.2 - // back-port the fix here. - if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs) - } - - // lutimes implementation, or no-op - if (!fs.lutimes) { - patchLutimes(fs) - } - - // https://github.com/isaacs/node-graceful-fs/issues/4 - // Chown should not fail on einval or eperm if non-root. - // It should not fail on enosys ever, as this just indicates - // that a fs doesn't support the intended operation. - - fs.chown = chownFix(fs.chown) - fs.fchown = chownFix(fs.fchown) - fs.lchown = chownFix(fs.lchown) - - fs.chmod = chmodFix(fs.chmod) - fs.fchmod = chmodFix(fs.fchmod) - fs.lchmod = chmodFix(fs.lchmod) - - fs.chownSync = chownFixSync(fs.chownSync) - fs.fchownSync = chownFixSync(fs.fchownSync) - fs.lchownSync = chownFixSync(fs.lchownSync) - - fs.chmodSync = chmodFixSync(fs.chmodSync) - fs.fchmodSync = chmodFixSync(fs.fchmodSync) - fs.lchmodSync = chmodFixSync(fs.lchmodSync) - - fs.stat = statFix(fs.stat) - fs.fstat = statFix(fs.fstat) - fs.lstat = statFix(fs.lstat) - - fs.statSync = statFixSync(fs.statSync) - fs.fstatSync = statFixSync(fs.fstatSync) - fs.lstatSync = statFixSync(fs.lstatSync) - - // if lchmod/lchown do not exist, then make them no-ops - if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - if (cb) process.nextTick(cb) - } - fs.lchmodSync = function () {} - } - if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - if (cb) process.nextTick(cb) - } - fs.lchownSync = function () {} - } - - // on Windows, A/V software can lock the directory, causing this - // to fail with an EACCES or EPERM if the directory contains newly - // created files. Try again on failure, for up to 60 seconds. - - // Set the timeout this long because some Windows Anti-Virus, such as Parity - // bit9, may lock files for up to a minute, causing npm package install - // failures. Also, take care to yield the scheduler. Windows scheduling gives - // CPU to a busy looping process, which can cause the program causing the lock - // contention to be starved of CPU by node, so the contention doesn't resolve. - if (platform === "win32") { - fs.rename = (function (fs$rename) { return function (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er) - }) - }})(fs.rename) - } - - // if read() returns EAGAIN, then just try it again. - fs.read = (function (fs$read) { - function read (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - - // This ensures `util.promisify` works as it does for native `fs.read`. - read.__proto__ = fs$read - return read - })(fs.read) - - fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return fs$readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } - }})(fs.readSync) - - function patchLchmod (fs) { - fs.lchmod = function (path, mode, callback) { - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - if (callback) callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - if (callback) callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var threw = true - var ret - try { - ret = fs.fchmodSync(fd, mode) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - } - - function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - if (er) { - if (cb) cb(er) - return - } - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - if (cb) cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - var ret - var threw = true - try { - ret = fs.futimesSync(fd, at, mt) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } - fs.lutimesSync = function () {} - } - } - - function chmodFix (orig) { - if (!orig) return orig - return function (target, mode, cb) { - return orig.call(fs, target, mode, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } - } - - function chmodFixSync (orig) { - if (!orig) return orig - return function (target, mode) { - try { - return orig.call(fs, target, mode) - } catch (er) { - if (!chownErOk(er)) throw er - } - } - } - - - function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } - } - - function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } - } - - function statFix (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - function callback (er, stats) { - if (stats) { - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - } - if (cb) cb.apply(this, arguments) - } - return options ? orig.call(fs, target, options, callback) - : orig.call(fs, target, callback) - } - } - - function statFixSync (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options) { - var stats = options ? orig.call(fs, target, options) - : orig.call(fs, target) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - return stats; - } - } - - // ENOSYS means that the fs doesn't support the op. Just ignore - // that, because it doesn't matter. - // - // if there's no getuid, or if getuid() is something other - // than 0, and the error is EINVAL or EPERM, then just ignore - // it. - // - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // - // When running as root, or if other types of errors are - // encountered, then it's strict. - function chownErOk (er) { - if (!er) - return true - - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - - return false - } -} - - -/***/ }), - -/***/ 15235: -/***/ (function(module) { - -"use strict"; - - -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 - } -} - - -/***/ }), - -/***/ 54983: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -var __webpack_unused_export__; - - -__webpack_unused_export__ = ({ - value: true -}); -exports.Z = void 0; - -const { - stringHints, - numberHints -} = __webpack_require__(79926); -/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ - -/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ - -/** @typedef {import("./validate").Schema} Schema */ - -/** @typedef {import("./validate").ValidationErrorConfiguration} ValidationErrorConfiguration */ - -/** @typedef {import("./validate").PostFormatter} PostFormatter */ - -/** @typedef {import("./validate").SchemaUtilErrorObject} SchemaUtilErrorObject */ - -/** @enum {number} */ - - -const SPECIFICITY = { - type: 1, - not: 1, - oneOf: 1, - anyOf: 1, - if: 1, - enum: 1, - const: 1, - instanceof: 1, - required: 2, - pattern: 2, - patternRequired: 2, - format: 2, - formatMinimum: 2, - formatMaximum: 2, - minimum: 2, - exclusiveMinimum: 2, - maximum: 2, - exclusiveMaximum: 2, - multipleOf: 2, - uniqueItems: 2, - contains: 2, - minLength: 2, - maxLength: 2, - minItems: 2, - maxItems: 2, - minProperties: 2, - maxProperties: 2, - dependencies: 2, - propertyNames: 2, - additionalItems: 2, - additionalProperties: 2, - absolutePath: 2 -}; -/** - * - * @param {Array} array - * @param {(item: SchemaUtilErrorObject) => number} fn - * @returns {Array} - */ - -function filterMax(array, fn) { - const evaluatedMax = array.reduce((max, item) => Math.max(max, fn(item)), 0); - return array.filter(item => fn(item) === evaluatedMax); -} -/** - * - * @param {Array} children - * @returns {Array} - */ - - -function filterChildren(children) { - let newChildren = children; - newChildren = filterMax(newChildren, - /** - * - * @param {SchemaUtilErrorObject} error - * @returns {number} - */ - error => error.dataPath ? error.dataPath.length : 0); - newChildren = filterMax(newChildren, - /** - * @param {SchemaUtilErrorObject} error - * @returns {number} - */ - error => SPECIFICITY[ - /** @type {keyof typeof SPECIFICITY} */ - error.keyword] || 2); - return newChildren; -} -/** - * Find all children errors - * @param {Array} children - * @param {Array} schemaPaths - * @return {number} returns index of first child - */ - - -function findAllChildren(children, schemaPaths) { - let i = children.length - 1; - - const predicate = - /** - * @param {string} schemaPath - * @returns {boolean} - */ - schemaPath => children[i].schemaPath.indexOf(schemaPath) !== 0; - - while (i > -1 && !schemaPaths.every(predicate)) { - if (children[i].keyword === "anyOf" || children[i].keyword === "oneOf") { - const refs = extractRefs(children[i]); - const childrenStart = findAllChildren(children.slice(0, i), refs.concat(children[i].schemaPath)); - i = childrenStart - 1; - } else { - i -= 1; - } - } - - return i + 1; -} -/** - * Extracts all refs from schema - * @param {SchemaUtilErrorObject} error - * @return {Array} - */ - - -function extractRefs(error) { - const { - schema - } = error; - - if (!Array.isArray(schema)) { - return []; - } - - return schema.map(({ - $ref - }) => $ref).filter(s => s); -} -/** - * Groups children by their first level parent (assuming that error is root) - * @param {Array} children - * @return {Array} - */ - - -function groupChildrenByFirstChild(children) { - const result = []; - let i = children.length - 1; - - while (i > 0) { - const child = children[i]; - - if (child.keyword === "anyOf" || child.keyword === "oneOf") { - const refs = extractRefs(child); - const childrenStart = findAllChildren(children.slice(0, i), refs.concat(child.schemaPath)); - - if (childrenStart !== i) { - result.push(Object.assign({}, child, { - children: children.slice(childrenStart, i) - })); - i = childrenStart; - } else { - result.push(child); - } - } else { - result.push(child); - } - - i -= 1; - } - - if (i === 0) { - result.push(children[i]); - } - - return result.reverse(); -} -/** - * @param {string} str - * @param {string} prefix - * @returns {string} - */ - - -function indent(str, prefix) { - return str.replace(/\n(?!$)/g, `\n${prefix}`); -} -/** - * @param {Schema} schema - * @returns {schema is (Schema & {not: Schema})} - */ - - -function hasNotInSchema(schema) { - return !!schema.not; -} -/** - * @param {Schema} schema - * @return {Schema} - */ - - -function findFirstTypedSchema(schema) { - if (hasNotInSchema(schema)) { - return findFirstTypedSchema(schema.not); - } - - return schema; -} -/** - * @param {Schema} schema - * @return {boolean} - */ - - -function canApplyNot(schema) { - const typedSchema = findFirstTypedSchema(schema); - return likeNumber(typedSchema) || likeInteger(typedSchema) || likeString(typedSchema) || likeNull(typedSchema) || likeBoolean(typedSchema); -} -/** - * @param {any} maybeObj - * @returns {boolean} - */ - - -function isObject(maybeObj) { - return typeof maybeObj === "object" && maybeObj !== null; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeNumber(schema) { - return schema.type === "number" || typeof schema.minimum !== "undefined" || typeof schema.exclusiveMinimum !== "undefined" || typeof schema.maximum !== "undefined" || typeof schema.exclusiveMaximum !== "undefined" || typeof schema.multipleOf !== "undefined"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeInteger(schema) { - return schema.type === "integer" || typeof schema.minimum !== "undefined" || typeof schema.exclusiveMinimum !== "undefined" || typeof schema.maximum !== "undefined" || typeof schema.exclusiveMaximum !== "undefined" || typeof schema.multipleOf !== "undefined"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeString(schema) { - return schema.type === "string" || typeof schema.minLength !== "undefined" || typeof schema.maxLength !== "undefined" || typeof schema.pattern !== "undefined" || typeof schema.format !== "undefined" || typeof schema.formatMinimum !== "undefined" || typeof schema.formatMaximum !== "undefined"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeBoolean(schema) { - return schema.type === "boolean"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeArray(schema) { - return schema.type === "array" || typeof schema.minItems === "number" || typeof schema.maxItems === "number" || typeof schema.uniqueItems !== "undefined" || typeof schema.items !== "undefined" || typeof schema.additionalItems !== "undefined" || typeof schema.contains !== "undefined"; -} -/** - * @param {Schema & {patternRequired?: Array}} schema - * @returns {boolean} - */ - - -function likeObject(schema) { - return schema.type === "object" || typeof schema.minProperties !== "undefined" || typeof schema.maxProperties !== "undefined" || typeof schema.required !== "undefined" || typeof schema.properties !== "undefined" || typeof schema.patternProperties !== "undefined" || typeof schema.additionalProperties !== "undefined" || typeof schema.dependencies !== "undefined" || typeof schema.propertyNames !== "undefined" || typeof schema.patternRequired !== "undefined"; -} -/** - * @param {Schema} schema - * @returns {boolean} - */ - - -function likeNull(schema) { - return schema.type === "null"; -} -/** - * @param {string} type - * @returns {string} - */ - - -function getArticle(type) { - if (/^[aeiou]/i.test(type)) { - return "an"; - } - - return "a"; -} -/** - * @param {Schema=} schema - * @returns {string} - */ - - -function getSchemaNonTypes(schema) { - if (!schema) { - return ""; - } - - if (!schema.type) { - if (likeNumber(schema) || likeInteger(schema)) { - return " | should be any non-number"; - } - - if (likeString(schema)) { - return " | should be any non-string"; - } - - if (likeArray(schema)) { - return " | should be any non-array"; - } - - if (likeObject(schema)) { - return " | should be any non-object"; - } - } - - return ""; -} -/** - * @param {Array} hints - * @returns {string} - */ - - -function formatHints(hints) { - return hints.length > 0 ? `(${hints.join(", ")})` : ""; -} -/** - * @param {Schema} schema - * @param {boolean} logic - * @returns {string[]} - */ - - -function getHints(schema, logic) { - if (likeNumber(schema) || likeInteger(schema)) { - return numberHints(schema, logic); - } else if (likeString(schema)) { - return stringHints(schema, logic); - } - - return []; -} - -class ValidationError extends Error { - /** - * @param {Array} errors - * @param {Schema} schema - * @param {ValidationErrorConfiguration} configuration - */ - constructor(errors, schema, configuration = {}) { - super(); - /** @type {string} */ - - this.name = "ValidationError"; - /** @type {Array} */ - - this.errors = errors; - /** @type {Schema} */ - - this.schema = schema; - let headerNameFromSchema; - let baseDataPathFromSchema; - - if (schema.title && (!configuration.name || !configuration.baseDataPath)) { - const splittedTitleFromSchema = schema.title.match(/^(.+) (.+)$/); - - if (splittedTitleFromSchema) { - if (!configuration.name) { - [, headerNameFromSchema] = splittedTitleFromSchema; - } - - if (!configuration.baseDataPath) { - [,, baseDataPathFromSchema] = splittedTitleFromSchema; - } - } - } - /** @type {string} */ - - - this.headerName = configuration.name || headerNameFromSchema || "Object"; - /** @type {string} */ - - this.baseDataPath = configuration.baseDataPath || baseDataPathFromSchema || "configuration"; - /** @type {PostFormatter | null} */ - - this.postFormatter = configuration.postFormatter || null; - const header = `Invalid ${this.baseDataPath} object. ${this.headerName} has been initialized using ${getArticle(this.baseDataPath)} ${this.baseDataPath} object that does not match the API schema.\n`; - /** @type {string} */ - - this.message = `${header}${this.formatValidationErrors(errors)}`; - Error.captureStackTrace(this, this.constructor); - } - /** - * @param {string} path - * @returns {Schema} - */ - - - getSchemaPart(path) { - const newPath = path.split("/"); - let schemaPart = this.schema; - - for (let i = 1; i < newPath.length; i++) { - const inner = schemaPart[ - /** @type {keyof Schema} */ - newPath[i]]; - - if (!inner) { - break; - } - - schemaPart = inner; - } - - return schemaPart; - } - /** - * @param {Schema} schema - * @param {boolean} logic - * @param {Array} prevSchemas - * @returns {string} - */ - - - formatSchema(schema, logic = true, prevSchemas = []) { - let newLogic = logic; - - const formatInnerSchema = - /** - * - * @param {Object} innerSchema - * @param {boolean=} addSelf - * @returns {string} - */ - (innerSchema, addSelf) => { - if (!addSelf) { - return this.formatSchema(innerSchema, newLogic, prevSchemas); - } - - if (prevSchemas.includes(innerSchema)) { - return "(recursive)"; - } - - return this.formatSchema(innerSchema, newLogic, prevSchemas.concat(schema)); - }; - - if (hasNotInSchema(schema) && !likeObject(schema)) { - if (canApplyNot(schema.not)) { - newLogic = !logic; - return formatInnerSchema(schema.not); - } - - const needApplyLogicHere = !schema.not.not; - const prefix = logic ? "" : "non "; - newLogic = !logic; - return needApplyLogicHere ? prefix + formatInnerSchema(schema.not) : formatInnerSchema(schema.not); - } - - if ( - /** @type {Schema & {instanceof: string | Array}} */ - schema.instanceof) { - const { - instanceof: value - } = - /** @type {Schema & {instanceof: string | Array}} */ - schema; - const values = !Array.isArray(value) ? [value] : value; - return values.map( - /** - * @param {string} item - * @returns {string} - */ - item => item === "Function" ? "function" : item).join(" | "); - } - - if (schema.enum) { - return ( - /** @type {Array} */ - schema.enum.map(item => JSON.stringify(item)).join(" | ") - ); - } - - if (typeof schema.const !== "undefined") { - return JSON.stringify(schema.const); - } - - if (schema.oneOf) { - return ( - /** @type {Array} */ - schema.oneOf.map(item => formatInnerSchema(item, true)).join(" | ") - ); - } - - if (schema.anyOf) { - return ( - /** @type {Array} */ - schema.anyOf.map(item => formatInnerSchema(item, true)).join(" | ") - ); - } - - if (schema.allOf) { - return ( - /** @type {Array} */ - schema.allOf.map(item => formatInnerSchema(item, true)).join(" & ") - ); - } - - if ( - /** @type {JSONSchema7} */ - schema.if) { - const { - if: ifValue, - then: thenValue, - else: elseValue - } = - /** @type {JSONSchema7} */ - schema; - return `${ifValue ? `if ${formatInnerSchema(ifValue)}` : ""}${thenValue ? ` then ${formatInnerSchema(thenValue)}` : ""}${elseValue ? ` else ${formatInnerSchema(elseValue)}` : ""}`; - } - - if (schema.$ref) { - return formatInnerSchema(this.getSchemaPart(schema.$ref), true); - } - - if (likeNumber(schema) || likeInteger(schema)) { - const [type, ...hints] = getHints(schema, logic); - const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : ""}`; - return logic ? str : hints.length > 0 ? `non-${type} | ${str}` : `non-${type}`; - } - - if (likeString(schema)) { - const [type, ...hints] = getHints(schema, logic); - const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : ""}`; - return logic ? str : str === "string" ? "non-string" : `non-string | ${str}`; - } - - if (likeBoolean(schema)) { - return `${logic ? "" : "non-"}boolean`; - } - - if (likeArray(schema)) { - // not logic already applied in formatValidationError - newLogic = true; - const hints = []; - - if (typeof schema.minItems === "number") { - hints.push(`should not have fewer than ${schema.minItems} item${schema.minItems > 1 ? "s" : ""}`); - } - - if (typeof schema.maxItems === "number") { - hints.push(`should not have more than ${schema.maxItems} item${schema.maxItems > 1 ? "s" : ""}`); - } - - if (schema.uniqueItems) { - hints.push("should not have duplicate items"); - } - - const hasAdditionalItems = typeof schema.additionalItems === "undefined" || Boolean(schema.additionalItems); - let items = ""; - - if (schema.items) { - if (Array.isArray(schema.items) && schema.items.length > 0) { - items = `${ - /** @type {Array} */ - schema.items.map(item => formatInnerSchema(item)).join(", ")}`; - - if (hasAdditionalItems) { - if (schema.additionalItems && isObject(schema.additionalItems) && Object.keys(schema.additionalItems).length > 0) { - hints.push(`additional items should be ${formatInnerSchema(schema.additionalItems)}`); - } - } - } else if (schema.items && Object.keys(schema.items).length > 0) { - // "additionalItems" is ignored - items = `${formatInnerSchema(schema.items)}`; - } else { - // Fallback for empty `items` value - items = "any"; - } - } else { - // "additionalItems" is ignored - items = "any"; - } - - if (schema.contains && Object.keys(schema.contains).length > 0) { - hints.push(`should contains at least one ${this.formatSchema(schema.contains)} item`); - } - - return `[${items}${hasAdditionalItems ? ", ..." : ""}]${hints.length > 0 ? ` (${hints.join(", ")})` : ""}`; - } - - if (likeObject(schema)) { - // not logic already applied in formatValidationError - newLogic = true; - const hints = []; - - if (typeof schema.minProperties === "number") { - hints.push(`should not have fewer than ${schema.minProperties} ${schema.minProperties > 1 ? "properties" : "property"}`); - } - - if (typeof schema.maxProperties === "number") { - hints.push(`should not have more than ${schema.maxProperties} ${schema.minProperties && schema.minProperties > 1 ? "properties" : "property"}`); - } - - if (schema.patternProperties && Object.keys(schema.patternProperties).length > 0) { - const patternProperties = Object.keys(schema.patternProperties); - hints.push(`additional property names should match pattern${patternProperties.length > 1 ? "s" : ""} ${patternProperties.map(pattern => JSON.stringify(pattern)).join(" | ")}`); - } - - const properties = schema.properties ? Object.keys(schema.properties) : []; - const required = schema.required ? schema.required : []; - const allProperties = [...new Set( - /** @type {Array} */ - [].concat(required).concat(properties))]; - const objectStructure = allProperties.map(property => { - const isRequired = required.includes(property); // Some properties need quotes, maybe we should add check - // Maybe we should output type of property (`foo: string`), but it is looks very unreadable - - return `${property}${isRequired ? "" : "?"}`; - }).concat(typeof schema.additionalProperties === "undefined" || Boolean(schema.additionalProperties) ? schema.additionalProperties && isObject(schema.additionalProperties) ? [`: ${formatInnerSchema(schema.additionalProperties)}`] : ["…"] : []).join(", "); - const { - dependencies, - propertyNames, - patternRequired - } = - /** @type {Schema & {patternRequired?: Array;}} */ - schema; - - if (dependencies) { - Object.keys(dependencies).forEach(dependencyName => { - const dependency = dependencies[dependencyName]; - - if (Array.isArray(dependency)) { - hints.push(`should have ${dependency.length > 1 ? "properties" : "property"} ${dependency.map(dep => `'${dep}'`).join(", ")} when property '${dependencyName}' is present`); - } else { - hints.push(`should be valid according to the schema ${formatInnerSchema(dependency)} when property '${dependencyName}' is present`); - } - }); - } - - if (propertyNames && Object.keys(propertyNames).length > 0) { - hints.push(`each property name should match format ${JSON.stringify(schema.propertyNames.format)}`); - } - - if (patternRequired && patternRequired.length > 0) { - hints.push(`should have property matching pattern ${patternRequired.map( - /** - * @param {string} item - * @returns {string} - */ - item => JSON.stringify(item))}`); - } - - return `object {${objectStructure ? ` ${objectStructure} ` : ""}}${hints.length > 0 ? ` (${hints.join(", ")})` : ""}`; - } - - if (likeNull(schema)) { - return `${logic ? "" : "non-"}null`; - } - - if (Array.isArray(schema.type)) { - // not logic already applied in formatValidationError - return `${schema.type.join(" | ")}`; - } // Fallback for unknown keywords - // not logic already applied in formatValidationError - - /* istanbul ignore next */ - - - return JSON.stringify(schema, null, 2); - } - /** - * @param {Schema=} schemaPart - * @param {(boolean | Array)=} additionalPath - * @param {boolean=} needDot - * @param {boolean=} logic - * @returns {string} - */ - - - getSchemaPartText(schemaPart, additionalPath, needDot = false, logic = true) { - if (!schemaPart) { - return ""; - } - - if (Array.isArray(additionalPath)) { - for (let i = 0; i < additionalPath.length; i++) { - /** @type {Schema | undefined} */ - const inner = schemaPart[ - /** @type {keyof Schema} */ - additionalPath[i]]; - - if (inner) { - // eslint-disable-next-line no-param-reassign - schemaPart = inner; - } else { - break; - } - } - } - - while (schemaPart.$ref) { - // eslint-disable-next-line no-param-reassign - schemaPart = this.getSchemaPart(schemaPart.$ref); - } - - let schemaText = `${this.formatSchema(schemaPart, logic)}${needDot ? "." : ""}`; - - if (schemaPart.description) { - schemaText += `\n-> ${schemaPart.description}`; - } - - if (schemaPart.link) { - schemaText += `\n-> Read more at ${schemaPart.link}`; - } - - return schemaText; - } - /** - * @param {Schema=} schemaPart - * @returns {string} - */ - - - getSchemaPartDescription(schemaPart) { - if (!schemaPart) { - return ""; - } - - while (schemaPart.$ref) { - // eslint-disable-next-line no-param-reassign - schemaPart = this.getSchemaPart(schemaPart.$ref); - } - - let schemaText = ""; - - if (schemaPart.description) { - schemaText += `\n-> ${schemaPart.description}`; - } - - if (schemaPart.link) { - schemaText += `\n-> Read more at ${schemaPart.link}`; - } - - return schemaText; - } - /** - * @param {SchemaUtilErrorObject} error - * @returns {string} - */ - - - formatValidationError(error) { - const { - keyword, - dataPath: errorDataPath - } = error; - const dataPath = `${this.baseDataPath}${errorDataPath}`; - - switch (keyword) { - case "type": - { - const { - parentSchema, - params - } = error; // eslint-disable-next-line default-case - - switch ( - /** @type {import("ajv").TypeParams} */ - params.type) { - case "number": - return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; - - case "integer": - return `${dataPath} should be an ${this.getSchemaPartText(parentSchema, false, true)}`; - - case "string": - return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; - - case "boolean": - return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; - - case "array": - return `${dataPath} should be an array:\n${this.getSchemaPartText(parentSchema)}`; - - case "object": - return `${dataPath} should be an object:\n${this.getSchemaPartText(parentSchema)}`; - - case "null": - return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; - - default: - return `${dataPath} should be:\n${this.getSchemaPartText(parentSchema)}`; - } - } - - case "instanceof": - { - const { - parentSchema - } = error; - return `${dataPath} should be an instance of ${this.getSchemaPartText(parentSchema, false, true)}`; - } - - case "pattern": - { - const { - params, - parentSchema - } = error; - const { - pattern - } = - /** @type {import("ajv").PatternParams} */ - params; - return `${dataPath} should match pattern ${JSON.stringify(pattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "format": - { - const { - params, - parentSchema - } = error; - const { - format - } = - /** @type {import("ajv").FormatParams} */ - params; - return `${dataPath} should match format ${JSON.stringify(format)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "formatMinimum": - case "formatMaximum": - { - const { - params, - parentSchema - } = error; - const { - comparison, - limit - } = - /** @type {import("ajv").ComparisonParams} */ - params; - return `${dataPath} should be ${comparison} ${JSON.stringify(limit)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "minimum": - case "maximum": - case "exclusiveMinimum": - case "exclusiveMaximum": - { - const { - parentSchema, - params - } = error; - const { - comparison, - limit - } = - /** @type {import("ajv").ComparisonParams} */ - params; - const [, ...hints] = getHints( - /** @type {Schema} */ - parentSchema, true); - - if (hints.length === 0) { - hints.push(`should be ${comparison} ${limit}`); - } - - return `${dataPath} ${hints.join(" ")}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "multipleOf": - { - const { - params, - parentSchema - } = error; - const { - multipleOf - } = - /** @type {import("ajv").MultipleOfParams} */ - params; - return `${dataPath} should be multiple of ${multipleOf}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "patternRequired": - { - const { - params, - parentSchema - } = error; - const { - missingPattern - } = - /** @type {import("ajv").PatternRequiredParams} */ - params; - return `${dataPath} should have property matching pattern ${JSON.stringify(missingPattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "minLength": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - - if (limit === 1) { - return `${dataPath} should be a non-empty string${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - const length = limit - 1; - return `${dataPath} should be longer than ${length} character${length > 1 ? "s" : ""}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "minItems": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - - if (limit === 1) { - return `${dataPath} should be a non-empty array${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - return `${dataPath} should not have fewer than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "minProperties": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - - if (limit === 1) { - return `${dataPath} should be a non-empty object${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - return `${dataPath} should not have fewer than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "maxLength": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - const max = limit + 1; - return `${dataPath} should be shorter than ${max} character${max > 1 ? "s" : ""}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "maxItems": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "maxProperties": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - return `${dataPath} should not have more than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "uniqueItems": - { - const { - params, - parentSchema - } = error; - const { - i - } = - /** @type {import("ajv").UniqueItemsParams} */ - params; - return `${dataPath} should not contain the item '${error.data[i]}' twice${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "additionalItems": - { - const { - params, - parentSchema - } = error; - const { - limit - } = - /** @type {import("ajv").LimitParams} */ - params; - return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}. These items are valid:\n${this.getSchemaPartText(parentSchema)}`; - } - - case "contains": - { - const { - parentSchema - } = error; - return `${dataPath} should contains at least one ${this.getSchemaPartText(parentSchema, ["contains"])} item${getSchemaNonTypes(parentSchema)}.`; - } - - case "required": - { - const { - parentSchema, - params - } = error; - const missingProperty = - /** @type {import("ajv").DependenciesParams} */ - params.missingProperty.replace(/^\./, ""); - const hasProperty = parentSchema && Boolean( - /** @type {Schema} */ - parentSchema.properties && - /** @type {Schema} */ - parentSchema.properties[missingProperty]); - return `${dataPath} misses the property '${missingProperty}'${getSchemaNonTypes(parentSchema)}.${hasProperty ? ` Should be:\n${this.getSchemaPartText(parentSchema, ["properties", missingProperty])}` : this.getSchemaPartDescription(parentSchema)}`; - } - - case "additionalProperties": - { - const { - params, - parentSchema - } = error; - const { - additionalProperty - } = - /** @type {import("ajv").AdditionalPropertiesParams} */ - params; - return `${dataPath} has an unknown property '${additionalProperty}'${getSchemaNonTypes(parentSchema)}. These properties are valid:\n${this.getSchemaPartText(parentSchema)}`; - } - - case "dependencies": - { - const { - params, - parentSchema - } = error; - const { - property, - deps - } = - /** @type {import("ajv").DependenciesParams} */ - params; - const dependencies = deps.split(",").map( - /** - * @param {string} dep - * @returns {string} - */ - dep => `'${dep.trim()}'`).join(", "); - return `${dataPath} should have properties ${dependencies} when property '${property}' is present${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "propertyNames": - { - const { - params, - parentSchema, - schema - } = error; - const { - propertyName - } = - /** @type {import("ajv").PropertyNamesParams} */ - params; - return `${dataPath} property name '${propertyName}' is invalid${getSchemaNonTypes(parentSchema)}. Property names should be match format ${JSON.stringify(schema.format)}.${this.getSchemaPartDescription(parentSchema)}`; - } - - case "enum": - { - const { - parentSchema - } = error; - - if (parentSchema && - /** @type {Schema} */ - parentSchema.enum && - /** @type {Schema} */ - parentSchema.enum.length === 1) { - return `${dataPath} should be ${this.getSchemaPartText(parentSchema, false, true)}`; - } - - return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}`; - } - - case "const": - { - const { - parentSchema - } = error; - return `${dataPath} should be equal to constant ${this.getSchemaPartText(parentSchema, false, true)}`; - } - - case "not": - { - const postfix = likeObject( - /** @type {Schema} */ - error.parentSchema) ? `\n${this.getSchemaPartText(error.parentSchema)}` : ""; - const schemaOutput = this.getSchemaPartText(error.schema, false, false, false); - - if (canApplyNot(error.schema)) { - return `${dataPath} should be any ${schemaOutput}${postfix}.`; - } - - const { - schema, - parentSchema - } = error; - return `${dataPath} should not be ${this.getSchemaPartText(schema, false, true)}${parentSchema && likeObject(parentSchema) ? `\n${this.getSchemaPartText(parentSchema)}` : ""}`; - } - - case "oneOf": - case "anyOf": - { - const { - parentSchema, - children - } = error; - - if (children && children.length > 0) { - if (error.schema.length === 1) { - const lastChild = children[children.length - 1]; - const remainingChildren = children.slice(0, children.length - 1); - return this.formatValidationError(Object.assign({}, lastChild, { - children: remainingChildren, - parentSchema: Object.assign({}, parentSchema, lastChild.parentSchema) - })); - } - - let filteredChildren = filterChildren(children); - - if (filteredChildren.length === 1) { - return this.formatValidationError(filteredChildren[0]); - } - - filteredChildren = groupChildrenByFirstChild(filteredChildren); - return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}\nDetails:\n${filteredChildren.map( - /** - * @param {SchemaUtilErrorObject} nestedError - * @returns {string} - */ - nestedError => ` * ${indent(this.formatValidationError(nestedError), " ")}`).join("\n")}`; - } - - return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}`; - } - - case "if": - { - const { - params, - parentSchema - } = error; - const { - failingKeyword - } = - /** @type {import("ajv").IfParams} */ - params; - return `${dataPath} should match "${failingKeyword}" schema:\n${this.getSchemaPartText(parentSchema, [failingKeyword])}`; - } - - case "absolutePath": - { - const { - message, - parentSchema - } = error; - return `${dataPath}: ${message}${this.getSchemaPartDescription(parentSchema)}`; - } - - /* istanbul ignore next */ - - default: - { - const { - message, - parentSchema - } = error; - const ErrorInJSON = JSON.stringify(error, null, 2); // For `custom`, `false schema`, `$ref` keywords - // Fallback for unknown keywords - - return `${dataPath} ${message} (${ErrorInJSON}).\n${this.getSchemaPartText(parentSchema, false)}`; - } - } - } - /** - * @param {Array} errors - * @returns {string} - */ - - - formatValidationErrors(errors) { - return errors.map(error => { - let formattedError = this.formatValidationError(error); - - if (this.postFormatter) { - formattedError = this.postFormatter(formattedError, error); - } - - return ` - ${indent(formattedError, " ")}`; - }).join("\n"); - } - -} - -var _default = ValidationError; -exports.Z = _default; - -/***/ }), - -/***/ 81184: -/***/ (function(module) { - -"use strict"; - - -/** - * @typedef {[number, boolean]} RangeValue - */ - -/** - * @callback RangeValueCallback - * @param {RangeValue} rangeValue - * @returns {boolean} - */ -class Range { - /** - * @param {"left" | "right"} side - * @param {boolean} exclusive - * @returns {">" | ">=" | "<" | "<="} - */ - static getOperator(side, exclusive) { - if (side === "left") { - return exclusive ? ">" : ">="; - } - - return exclusive ? "<" : "<="; - } - /** - * @param {number} value - * @param {boolean} logic is not logic applied - * @param {boolean} exclusive is range exclusive - * @returns {string} - */ - - - static formatRight(value, logic, exclusive) { - if (logic === false) { - return Range.formatLeft(value, !logic, !exclusive); - } - - return `should be ${Range.getOperator("right", exclusive)} ${value}`; - } - /** - * @param {number} value - * @param {boolean} logic is not logic applied - * @param {boolean} exclusive is range exclusive - * @returns {string} - */ - - - static formatLeft(value, logic, exclusive) { - if (logic === false) { - return Range.formatRight(value, !logic, !exclusive); - } - - return `should be ${Range.getOperator("left", exclusive)} ${value}`; - } - /** - * @param {number} start left side value - * @param {number} end right side value - * @param {boolean} startExclusive is range exclusive from left side - * @param {boolean} endExclusive is range exclusive from right side - * @param {boolean} logic is not logic applied - * @returns {string} - */ - - - static formatRange(start, end, startExclusive, endExclusive, logic) { - let result = "should be"; - result += ` ${Range.getOperator(logic ? "left" : "right", logic ? startExclusive : !startExclusive)} ${start} `; - result += logic ? "and" : "or"; - result += ` ${Range.getOperator(logic ? "right" : "left", logic ? endExclusive : !endExclusive)} ${end}`; - return result; - } - /** - * @param {Array} values - * @param {boolean} logic is not logic applied - * @return {RangeValue} computed value and it's exclusive flag - */ - - - static getRangeValue(values, logic) { - let minMax = logic ? Infinity : -Infinity; - let j = -1; - const predicate = logic ? - /** @type {RangeValueCallback} */ - ([value]) => value <= minMax : - /** @type {RangeValueCallback} */ - ([value]) => value >= minMax; - - for (let i = 0; i < values.length; i++) { - if (predicate(values[i])) { - [minMax] = values[i]; - j = i; - } - } - - if (j > -1) { - return values[j]; - } - - return [Infinity, true]; - } - - constructor() { - /** @type {Array} */ - this._left = []; - /** @type {Array} */ - - this._right = []; - } - /** - * @param {number} value - * @param {boolean=} exclusive - */ - - - left(value, exclusive = false) { - this._left.push([value, exclusive]); - } - /** - * @param {number} value - * @param {boolean=} exclusive - */ - - - right(value, exclusive = false) { - this._right.push([value, exclusive]); - } - /** - * @param {boolean} logic is not logic applied - * @return {string} "smart" range string representation - */ - - - format(logic = true) { - const [start, leftExclusive] = Range.getRangeValue(this._left, logic); - const [end, rightExclusive] = Range.getRangeValue(this._right, !logic); - - if (!Number.isFinite(start) && !Number.isFinite(end)) { - return ""; - } - - const realStart = leftExclusive ? start + 1 : start; - const realEnd = rightExclusive ? end - 1 : end; // e.g. 5 < x < 7, 5 < x <= 6, 6 <= x <= 6 - - if (realStart === realEnd) { - return `should be ${logic ? "" : "!"}= ${realStart}`; - } // e.g. 4 < x < ∞ - - - if (Number.isFinite(start) && !Number.isFinite(end)) { - return Range.formatLeft(start, logic, leftExclusive); - } // e.g. ∞ < x < 4 - - - if (!Number.isFinite(start) && Number.isFinite(end)) { - return Range.formatRight(end, logic, rightExclusive); - } - - return Range.formatRange(start, end, leftExclusive, rightExclusive, logic); - } - -} - -module.exports = Range; - -/***/ }), - -/***/ 79926: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; - - -const Range = __webpack_require__(81184); -/** @typedef {import("../validate").Schema} Schema */ - -/** - * @param {Schema} schema - * @param {boolean} logic - * @return {string[]} - */ - - -module.exports.stringHints = function stringHints(schema, logic) { - const hints = []; - let type = "string"; - const currentSchema = { ...schema - }; - - if (!logic) { - const tmpLength = currentSchema.minLength; - const tmpFormat = currentSchema.formatMinimum; - const tmpExclusive = currentSchema.formatExclusiveMaximum; - currentSchema.minLength = currentSchema.maxLength; - currentSchema.maxLength = tmpLength; - currentSchema.formatMinimum = currentSchema.formatMaximum; - currentSchema.formatMaximum = tmpFormat; - currentSchema.formatExclusiveMaximum = !currentSchema.formatExclusiveMinimum; - currentSchema.formatExclusiveMinimum = !tmpExclusive; - } - - if (typeof currentSchema.minLength === "number") { - if (currentSchema.minLength === 1) { - type = "non-empty string"; - } else { - const length = Math.max(currentSchema.minLength - 1, 0); - hints.push(`should be longer than ${length} character${length > 1 ? "s" : ""}`); - } - } - - if (typeof currentSchema.maxLength === "number") { - if (currentSchema.maxLength === 0) { - type = "empty string"; - } else { - const length = currentSchema.maxLength + 1; - hints.push(`should be shorter than ${length} character${length > 1 ? "s" : ""}`); - } - } - - if (currentSchema.pattern) { - hints.push(`should${logic ? "" : " not"} match pattern ${JSON.stringify(currentSchema.pattern)}`); - } - - if (currentSchema.format) { - hints.push(`should${logic ? "" : " not"} match format ${JSON.stringify(currentSchema.format)}`); - } - - if (currentSchema.formatMinimum) { - hints.push(`should be ${currentSchema.formatExclusiveMinimum ? ">" : ">="} ${JSON.stringify(currentSchema.formatMinimum)}`); - } - - if (currentSchema.formatMaximum) { - hints.push(`should be ${currentSchema.formatExclusiveMaximum ? "<" : "<="} ${JSON.stringify(currentSchema.formatMaximum)}`); - } - - return [type].concat(hints); -}; -/** - * @param {Schema} schema - * @param {boolean} logic - * @return {string[]} - */ - - -module.exports.numberHints = function numberHints(schema, logic) { - const hints = [schema.type === "integer" ? "integer" : "number"]; - const range = new Range(); - - if (typeof schema.minimum === "number") { - range.left(schema.minimum); - } - - if (typeof schema.exclusiveMinimum === "number") { - range.left(schema.exclusiveMinimum, true); - } - - if (typeof schema.maximum === "number") { - range.right(schema.maximum); - } - - if (typeof schema.exclusiveMaximum === "number") { - range.right(schema.exclusiveMaximum, true); - } - - const rangeFormat = range.format(logic); - - if (rangeFormat) { - hints.push(rangeFormat); - } - - if (typeof schema.multipleOf === "number") { - hints.push(`should${logic ? "" : " not"} be multiple of ${schema.multipleOf}`); - } - - return hints; -}; - -/***/ }), - -/***/ 30036: -/***/ (function(module) { +/***/ 32087: +/***/ (function(module) { /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -16810,6 +10137,6764 @@ var __classPrivateFieldSet; }); +/***/ }), + +/***/ 70665: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +const Variable = __webpack_require__(82971); + +/** + * @class Definition + */ +class Definition { + constructor(type, name, node, parent, index, kind) { + + /** + * @member {String} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...). + */ + this.type = type; + + /** + * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence. + */ + this.name = name; + + /** + * @member {espree.Node} Definition#node - the enclosing node of the identifier. + */ + this.node = node; + + /** + * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier. + */ + this.parent = parent; + + /** + * @member {Number?} Definition#index - the index in the declaration statement. + */ + this.index = index; + + /** + * @member {String?} Definition#kind - the kind of the declaration statement. + */ + this.kind = kind; + } +} + +/** + * @class ParameterDefinition + */ +class ParameterDefinition extends Definition { + constructor(name, node, index, rest) { + super(Variable.Parameter, name, node, null, index, null); + + /** + * Whether the parameter definition is a part of a rest parameter. + * @member {boolean} ParameterDefinition#rest + */ + this.rest = rest; + } +} + +module.exports = { + ParameterDefinition, + Definition +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 36007: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Copyright (C) 2012-2014 Yusuke Suzuki + Copyright (C) 2013 Alex Seville + Copyright (C) 2014 Thiago de Arruda + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Escope (escope) is an ECMAScript + * scope analyzer extracted from the esmangle project. + *

+ * escope finds lexical scopes in a source program, i.e. areas of that + * program where different occurrences of the same identifier refer to the same + * variable. With each scope the contained variables are collected, and each + * identifier reference in code is linked to its corresponding variable (if + * possible). + *

+ * escope works on a syntax tree of the parsed source code which has + * to adhere to the + * Mozilla Parser API. E.g. espree is a parser + * that produces such syntax trees. + *

+ * The main interface is the {@link analyze} function. + * @module escope + */ + + +/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */ + +const assert = __webpack_require__(39491); + +const ScopeManager = __webpack_require__(96988); +const Referencer = __webpack_require__(44585); +const Reference = __webpack_require__(64945); +const Variable = __webpack_require__(82971); +const Scope = (__webpack_require__(16313).Scope); +const version = (__webpack_require__(30290)/* .version */ .i8); + +/** + * Set the default options + * @returns {Object} options + */ +function defaultOptions() { + return { + optimistic: false, + directive: false, + nodejsScope: false, + impliedStrict: false, + sourceType: "script", // one of ['script', 'module'] + ecmaVersion: 5, + childVisitorKeys: null, + fallback: "iteration" + }; +} + +/** + * Preform deep update on option object + * @param {Object} target - Options + * @param {Object} override - Updates + * @returns {Object} Updated options + */ +function updateDeeply(target, override) { + + /** + * Is hash object + * @param {Object} value - Test value + * @returns {boolean} Result + */ + function isHashObject(value) { + return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp); + } + + for (const key in override) { + if (Object.prototype.hasOwnProperty.call(override, key)) { + const val = override[key]; + + if (isHashObject(val)) { + if (isHashObject(target[key])) { + updateDeeply(target[key], val); + } else { + target[key] = updateDeeply({}, val); + } + } else { + target[key] = val; + } + } + } + return target; +} + +/** + * Main interface function. Takes an Espree syntax tree and returns the + * analyzed scopes. + * @function analyze + * @param {espree.Tree} tree - Abstract Syntax Tree + * @param {Object} providedOptions - Options that tailor the scope analysis + * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag + * @param {boolean} [providedOptions.directive=false]- the directive flag + * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls + * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole + * script is executed under node.js environment. When enabled, escope adds + * a function scope immediately following the global scope. + * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode + * (if ecmaVersion >= 5). + * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module' + * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered + * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option. + * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option. + * @returns {ScopeManager} ScopeManager + */ +function analyze(tree, providedOptions) { + const options = updateDeeply(defaultOptions(), providedOptions); + const scopeManager = new ScopeManager(options); + const referencer = new Referencer(options, scopeManager); + + referencer.visit(tree); + + assert(scopeManager.__currentScope === null, "currentScope should be null."); + + return scopeManager; +} + +module.exports = { + + /** @name module:escope.version */ + version, + + /** @name module:escope.Reference */ + Reference, + + /** @name module:escope.Variable */ + Variable, + + /** @name module:escope.Scope */ + Scope, + + /** @name module:escope.ScopeManager */ + ScopeManager, + analyze +}; + + +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 54162: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +/* eslint-disable no-undefined */ + +const Syntax = (__webpack_require__(18350).Syntax); +const esrecurse = __webpack_require__(81217); + +/** + * Get last array element + * @param {array} xs - array + * @returns {any} Last elment + */ +function getLast(xs) { + return xs[xs.length - 1] || null; +} + +class PatternVisitor extends esrecurse.Visitor { + static isPattern(node) { + const nodeType = node.type; + + return ( + nodeType === Syntax.Identifier || + nodeType === Syntax.ObjectPattern || + nodeType === Syntax.ArrayPattern || + nodeType === Syntax.SpreadElement || + nodeType === Syntax.RestElement || + nodeType === Syntax.AssignmentPattern + ); + } + + constructor(options, rootPattern, callback) { + super(null, options); + this.rootPattern = rootPattern; + this.callback = callback; + this.assignments = []; + this.rightHandNodes = []; + this.restElements = []; + } + + Identifier(pattern) { + const lastRestElement = getLast(this.restElements); + + this.callback(pattern, { + topLevel: pattern === this.rootPattern, + rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern, + assignments: this.assignments + }); + } + + Property(property) { + + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + + ArrayPattern(pattern) { + for (let i = 0, iz = pattern.elements.length; i < iz; ++i) { + const element = pattern.elements[i]; + + this.visit(element); + } + } + + AssignmentPattern(pattern) { + this.assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.assignments.pop(); + } + + RestElement(pattern) { + this.restElements.push(pattern); + this.visit(pattern.argument); + this.restElements.pop(); + } + + MemberExpression(node) { + + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + + // + // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression. + // By spec, LeftHandSideExpression is Pattern or MemberExpression. + // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758) + // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc... + // + + SpreadElement(node) { + this.visit(node.argument); + } + + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + + AssignmentExpression(node) { + this.assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.assignments.pop(); + } + + CallExpression(node) { + + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } +} + +module.exports = PatternVisitor; + +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 64945: +/***/ (function(module) { + +"use strict"; +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +const READ = 0x1; +const WRITE = 0x2; +const RW = READ | WRITE; + +/** + * A Reference represents a single occurrence of an identifier in code. + * @class Reference + */ +class Reference { + constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) { + + /** + * Identifier syntax node. + * @member {espreeIdentifier} Reference#identifier + */ + this.identifier = ident; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Reference#from + */ + this.from = scope; + + /** + * Whether the reference comes from a dynamic scope (such as 'eval', + * 'with', etc.), and may be trapped by dynamic scopes. + * @member {boolean} Reference#tainted + */ + this.tainted = false; + + /** + * The variable this reference is resolved with. + * @member {Variable} Reference#resolved + */ + this.resolved = null; + + /** + * The read-write mode of the reference. (Value is one of {@link + * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}). + * @member {number} Reference#flag + * @private + */ + this.flag = flag; + if (this.isWrite()) { + + /** + * If reference is writeable, this is the tree being written to it. + * @member {espreeNode} Reference#writeExpr + */ + this.writeExpr = writeExpr; + + /** + * Whether the Reference might refer to a partial value of writeExpr. + * @member {boolean} Reference#partial + */ + this.partial = partial; + + /** + * Whether the Reference is to write of initialization. + * @member {boolean} Reference#init + */ + this.init = init; + } + this.__maybeImplicitGlobal = maybeImplicitGlobal; + } + + /** + * Whether the reference is static. + * @method Reference#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.tainted && this.resolved && this.resolved.scope.isStatic(); + } + + /** + * Whether the reference is writeable. + * @method Reference#isWrite + * @returns {boolean} write + */ + isWrite() { + return !!(this.flag & Reference.WRITE); + } + + /** + * Whether the reference is readable. + * @method Reference#isRead + * @returns {boolean} read + */ + isRead() { + return !!(this.flag & Reference.READ); + } + + /** + * Whether the reference is read-only. + * @method Reference#isReadOnly + * @returns {boolean} read only + */ + isReadOnly() { + return this.flag === Reference.READ; + } + + /** + * Whether the reference is write-only. + * @method Reference#isWriteOnly + * @returns {boolean} write only + */ + isWriteOnly() { + return this.flag === Reference.WRITE; + } + + /** + * Whether the reference is read-write. + * @method Reference#isReadWrite + * @returns {boolean} read write + */ + isReadWrite() { + return this.flag === Reference.RW; + } +} + +/** + * @constant Reference.READ + * @private + */ +Reference.READ = READ; + +/** + * @constant Reference.WRITE + * @private + */ +Reference.WRITE = WRITE; + +/** + * @constant Reference.RW + * @private + */ +Reference.RW = RW; + +module.exports = Reference; + +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 44585: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +/* eslint-disable no-underscore-dangle */ +/* eslint-disable no-undefined */ + +const Syntax = (__webpack_require__(18350).Syntax); +const esrecurse = __webpack_require__(81217); +const Reference = __webpack_require__(64945); +const Variable = __webpack_require__(82971); +const PatternVisitor = __webpack_require__(54162); +const definition = __webpack_require__(70665); +const assert = __webpack_require__(39491); + +const ParameterDefinition = definition.ParameterDefinition; +const Definition = definition.Definition; + +/** + * Traverse identifier in pattern + * @param {Object} options - options + * @param {pattern} rootPattern - root pattern + * @param {Refencer} referencer - referencer + * @param {callback} callback - callback + * @returns {void} + */ +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) { + + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor(options, rootPattern, callback); + + visitor.visit(rootPattern); + + // Process the right hand nodes recursively. + if (referencer !== null && referencer !== undefined) { + visitor.rightHandNodes.forEach(referencer.visit, referencer); + } +} + +// Importing ImportDeclaration. +// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation +// https://github.com/estree/estree/blob/master/es6.md#importdeclaration +// FIXME: Now, we don't create module environment, because the context is +// implementation dependent. + +class Importer extends esrecurse.Visitor { + constructor(declaration, referencer) { + super(null, referencer.options); + this.declaration = declaration; + this.referencer = referencer; + } + + visitImport(id, specifier) { + this.referencer.visitPattern(id, pattern => { + this.referencer.currentScope().__define(pattern, + new Definition( + Variable.ImportBinding, + pattern, + specifier, + this.declaration, + null, + null + )); + }); + } + + ImportNamespaceSpecifier(node) { + const local = (node.local || node.id); + + if (local) { + this.visitImport(local, node); + } + } + + ImportDefaultSpecifier(node) { + const local = (node.local || node.id); + + this.visitImport(local, node); + } + + ImportSpecifier(node) { + const local = (node.local || node.id); + + if (node.name) { + this.visitImport(node.name, node); + } else { + this.visitImport(local, node); + } + } +} + +// Referencing variables and creating bindings. +class Referencer extends esrecurse.Visitor { + constructor(options, scopeManager) { + super(null, options); + this.options = options; + this.scopeManager = scopeManager; + this.parent = null; + this.isInnerMethodDefinition = false; + } + + currentScope() { + return this.scopeManager.__currentScope; + } + + close(node) { + while (this.currentScope() && node === this.currentScope().block) { + this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager); + } + } + + pushInnerMethodDefinition(isInnerMethodDefinition) { + const previous = this.isInnerMethodDefinition; + + this.isInnerMethodDefinition = isInnerMethodDefinition; + return previous; + } + + popInnerMethodDefinition(isInnerMethodDefinition) { + this.isInnerMethodDefinition = isInnerMethodDefinition; + } + + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + const scope = this.currentScope(); + + assignments.forEach(assignment => { + scope.__referencing( + pattern, + Reference.WRITE, + assignment.right, + maybeImplicitGlobal, + pattern !== assignment.left, + init + ); + }); + } + + visitPattern(node, options, callback) { + let visitPatternOptions = options; + let visitPatternCallback = callback; + + if (typeof options === "function") { + visitPatternCallback = options; + visitPatternOptions = { processRightHandNodes: false }; + } + + traverseIdentifierInPattern( + this.options, + node, + visitPatternOptions.processRightHandNodes ? this : null, + visitPatternCallback + ); + } + + visitFunction(node) { + let i, iz; + + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + + if (node.type === Syntax.FunctionDeclaration) { + + // id is defined in upper scope + this.currentScope().__define(node.id, + new Definition( + Variable.FunctionName, + node.id, + node, + null, + null, + null + )); + } + + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + if (node.type === Syntax.FunctionExpression && node.id) { + this.scopeManager.__nestFunctionExpressionNameScope(node); + } + + // Consider this function is in the MethodDefinition. + this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); + + const that = this; + + /** + * Visit pattern callback + * @param {pattern} pattern - pattern + * @param {Object} info - info + * @returns {void} + */ + function visitPatternCallback(pattern, info) { + that.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + i, + info.rest + )); + + that.referencingDefaultValue(pattern, info.assignments, null, true); + } + + // Process parameter declarations. + for (i = 0, iz = node.params.length; i < iz; ++i) { + this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback); + } + + // if there's a rest argument, add that + if (node.rest) { + this.visitPattern({ + type: "RestElement", + argument: node.rest + }, pattern => { + this.currentScope().__define(pattern, + new ParameterDefinition( + pattern, + node, + node.params.length, + true + )); + }); + } + + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === Syntax.BlockStatement) { + this.visitChildren(node.body); + } else { + this.visit(node.body); + } + } + + this.close(node); + } + + visitClass(node) { + if (node.type === Syntax.ClassDeclaration) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node, + null, + null, + null + )); + } + + this.visit(node.superClass); + + this.scopeManager.__nestClassScope(node); + + if (node.id) { + this.currentScope().__define(node.id, + new Definition( + Variable.ClassName, + node.id, + node + )); + } + this.visit(node.body); + + this.close(node); + } + + visitProperty(node) { + let previous; + + if (node.computed) { + this.visit(node.key); + } + + const isMethodDefinition = node.type === Syntax.MethodDefinition; + + if (isMethodDefinition) { + previous = this.pushInnerMethodDefinition(true); + } + this.visit(node.value); + if (isMethodDefinition) { + this.popInnerMethodDefinition(previous); + } + } + + visitForIn(node) { + if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + if (node.left.type === Syntax.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true); + }); + } else { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false); + }); + } + this.visit(node.right); + this.visit(node.body); + + this.close(node); + } + + visitVariableDeclaration(variableTargetScope, type, node, index) { + + const decl = node.declarations[index]; + const init = decl.init; + + this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => { + variableTargetScope.__define( + pattern, + new Definition( + type, + pattern, + decl, + node, + index, + node.kind + ) + ); + + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true); + } + }); + } + + AssignmentExpression(node) { + if (PatternVisitor.isPattern(node.left)) { + if (node.operator === "=") { + this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => { + let maybeImplicitGlobal = null; + + if (!this.currentScope().isStrict) { + maybeImplicitGlobal = { + pattern, + node + }; + } + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false); + }); + } else { + this.currentScope().__referencing(node.left, Reference.RW, node.right); + } + } else { + this.visit(node.left); + } + this.visit(node.right); + } + + CatchClause(node) { + this.scopeManager.__nestCatchScope(node); + + this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => { + this.currentScope().__define(pattern, + new Definition( + Variable.CatchClause, + node.param, + node, + null, + null, + null + )); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }); + this.visit(node.body); + + this.close(node); + } + + Program(node) { + this.scopeManager.__nestGlobalScope(node); + + if (this.scopeManager.__isNodejsScope()) { + + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.__nestFunctionScope(node, false); + } + + if (this.scopeManager.__isES6() && this.scopeManager.isModule()) { + this.scopeManager.__nestModuleScope(node); + } + + if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + + this.visitChildren(node); + this.close(node); + } + + Identifier(node) { + this.currentScope().__referencing(node); + } + + UpdateExpression(node) { + if (PatternVisitor.isPattern(node.argument)) { + this.currentScope().__referencing(node.argument, Reference.RW, null); + } else { + this.visitChildren(node); + } + } + + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + + Property(node) { + this.visitProperty(node); + } + + MethodDefinition(node) { + this.visitProperty(node); + } + + BreakStatement() {} // eslint-disable-line class-methods-use-this + + ContinueStatement() {} // eslint-disable-line class-methods-use-this + + LabeledStatement(node) { + this.visit(node.body); + } + + ForStatement(node) { + + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates + // per iteration environment. However, escope is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") { + this.scopeManager.__nestForScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ClassExpression(node) { + this.visitClass(node); + } + + ClassDeclaration(node) { + this.visitClass(node); + } + + CallExpression(node) { + + // Check this is direct call to eval + if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") { + + // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and + // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment. + this.currentScope().variableScope.__detectEval(); + } + this.visitChildren(node); + } + + BlockStatement(node) { + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestBlockScope(node); + } + + this.visitChildren(node); + + this.close(node); + } + + ThisExpression() { + this.currentScope().variableScope.__detectThis(); + } + + WithStatement(node) { + this.visit(node.object); + + // Then nest scope for WithStatement. + this.scopeManager.__nestWithScope(node); + + this.visit(node.body); + + this.close(node); + } + + VariableDeclaration(node) { + const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope(); + + for (let i = 0, iz = node.declarations.length; i < iz; ++i) { + const decl = node.declarations[i]; + + this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i); + if (decl.init) { + this.visit(decl.init); + } + } + } + + // sec 13.11.8 + SwitchStatement(node) { + this.visit(node.discriminant); + + if (this.scopeManager.__isES6()) { + this.scopeManager.__nestSwitchScope(node); + } + + for (let i = 0, iz = node.cases.length; i < iz; ++i) { + this.visit(node.cases[i]); + } + + this.close(node); + } + + FunctionDeclaration(node) { + this.visitFunction(node); + } + + FunctionExpression(node) { + this.visitFunction(node); + } + + ForOfStatement(node) { + this.visitForIn(node); + } + + ForInStatement(node) { + this.visitForIn(node); + } + + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + + ImportDeclaration(node) { + assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context."); + + const importer = new Importer(node, this); + + importer.visit(node); + } + + visitExportDeclaration(node) { + if (node.source) { + return; + } + if (node.declaration) { + this.visit(node.declaration); + return; + } + + this.visitChildren(node); + } + + // TODO: ExportDeclaration doesn't exist. for bc? + ExportDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportAllDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportDefaultDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportNamedDeclaration(node) { + this.visitExportDeclaration(node); + } + + ExportSpecifier(node) { + + // TODO: `node.id` doesn't exist. for bc? + const local = (node.id || node.local); + + this.visit(local); + } + + MetaProperty() { // eslint-disable-line class-methods-use-this + + // do nothing. + } +} + +module.exports = Referencer; + +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 96988: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +/* eslint-disable no-underscore-dangle */ + +const Scope = __webpack_require__(16313); +const assert = __webpack_require__(39491); + +const GlobalScope = Scope.GlobalScope; +const CatchScope = Scope.CatchScope; +const WithScope = Scope.WithScope; +const ModuleScope = Scope.ModuleScope; +const ClassScope = Scope.ClassScope; +const SwitchScope = Scope.SwitchScope; +const FunctionScope = Scope.FunctionScope; +const ForScope = Scope.ForScope; +const FunctionExpressionNameScope = Scope.FunctionExpressionNameScope; +const BlockScope = Scope.BlockScope; + +/** + * @class ScopeManager + */ +class ScopeManager { + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.__nodeToScope = new WeakMap(); + this.__currentScope = null; + this.__options = options; + this.__declaredVariables = new WeakMap(); + } + + __useDirective() { + return this.__options.directive; + } + + __isOptimistic() { + return this.__options.optimistic; + } + + __ignoreEval() { + return this.__options.ignoreEval; + } + + __isNodejsScope() { + return this.__options.nodejsScope; + } + + isModule() { + return this.__options.sourceType === "module"; + } + + isImpliedStrict() { + return this.__options.impliedStrict; + } + + isStrictModeSupported() { + return this.__options.ecmaVersion >= 5; + } + + // Returns appropriate scope for this node. + __get(node) { + return this.__nodeToScope.get(node); + } + + /** + * Get variables that are declared by the node. + * + * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`. + * If the node declares nothing, this method returns an empty array. + * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details. + * + * @param {Espree.Node} node - a node to get. + * @returns {Variable[]} variables that declared by the node. + */ + getDeclaredVariables(node) { + return this.__declaredVariables.get(node) || []; + } + + /** + * acquire scope from node. + * @method ScopeManager#acquire + * @param {Espree.Node} node - node for the acquired scope. + * @param {boolean=} inner - look up the most inner scope, default value is false. + * @returns {Scope?} Scope from node + */ + acquire(node, inner) { + + /** + * predicate + * @param {Scope} testScope - scope to test + * @returns {boolean} predicate + */ + function predicate(testScope) { + if (testScope.type === "function" && testScope.functionExpressionScope) { + return false; + } + return true; + } + + const scopes = this.__get(node); + + if (!scopes || scopes.length === 0) { + return null; + } + + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } else { + for (let i = 0, iz = scopes.length; i < iz; ++i) { + const scope = scopes[i]; + + if (predicate(scope)) { + return scope; + } + } + } + + return null; + } + + /** + * acquire all scopes from node. + * @method ScopeManager#acquireAll + * @param {Espree.Node} node - node for the acquired scope. + * @returns {Scopes?} Scope array + */ + acquireAll(node) { + return this.__get(node); + } + + /** + * release the node. + * @method ScopeManager#release + * @param {Espree.Node} node - releasing node. + * @param {boolean=} inner - look up the most inner scope, default value is false. + * @returns {Scope?} upper scope for the node. + */ + release(node, inner) { + const scopes = this.__get(node); + + if (scopes && scopes.length) { + const scope = scopes[0].upper; + + if (!scope) { + return null; + } + return this.acquire(scope.block, inner); + } + return null; + } + + attach() { } // eslint-disable-line class-methods-use-this + + detach() { } // eslint-disable-line class-methods-use-this + + __nestScope(scope) { + if (scope instanceof GlobalScope) { + assert(this.__currentScope === null); + this.globalScope = scope; + } + this.__currentScope = scope; + return scope; + } + + __nestGlobalScope(node) { + return this.__nestScope(new GlobalScope(this, node)); + } + + __nestBlockScope(node) { + return this.__nestScope(new BlockScope(this, this.__currentScope, node)); + } + + __nestFunctionScope(node, isMethodDefinition) { + return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition)); + } + + __nestForScope(node) { + return this.__nestScope(new ForScope(this, this.__currentScope, node)); + } + + __nestCatchScope(node) { + return this.__nestScope(new CatchScope(this, this.__currentScope, node)); + } + + __nestWithScope(node) { + return this.__nestScope(new WithScope(this, this.__currentScope, node)); + } + + __nestClassScope(node) { + return this.__nestScope(new ClassScope(this, this.__currentScope, node)); + } + + __nestSwitchScope(node) { + return this.__nestScope(new SwitchScope(this, this.__currentScope, node)); + } + + __nestModuleScope(node) { + return this.__nestScope(new ModuleScope(this, this.__currentScope, node)); + } + + __nestFunctionExpressionNameScope(node) { + return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node)); + } + + __isES6() { + return this.__options.ecmaVersion >= 6; + } +} + +module.exports = ScopeManager; + +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 16313: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +/* eslint-disable no-underscore-dangle */ +/* eslint-disable no-undefined */ + +const Syntax = (__webpack_require__(18350).Syntax); + +const Reference = __webpack_require__(64945); +const Variable = __webpack_require__(82971); +const Definition = (__webpack_require__(70665).Definition); +const assert = __webpack_require__(39491); + +/** + * Test if scope is struct + * @param {Scope} scope - scope + * @param {Block} block - block + * @param {boolean} isMethodDefinition - is method definition + * @param {boolean} useDirective - use directive + * @returns {boolean} is strict scope + */ +function isStrictScope(scope, block, isMethodDefinition, useDirective) { + let body; + + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper && scope.upper.isStrict) { + return true; + } + + if (isMethodDefinition) { + return true; + } + + if (scope.type === "class" || scope.type === "module") { + return true; + } + + if (scope.type === "block" || scope.type === "switch") { + return false; + } + + if (scope.type === "function") { + if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) { + return false; + } + + if (block.type === Syntax.Program) { + body = block; + } else { + body = block.body; + } + + if (!body) { + return false; + } + } else if (scope.type === "global") { + body = block; + } else { + return false; + } + + // Search 'use strict' directive. + if (useDirective) { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax.DirectiveStatement) { + break; + } + if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") { + return true; + } + } + } else { + for (let i = 0, iz = body.body.length; i < iz; ++i) { + const stmt = body.body[i]; + + if (stmt.type !== Syntax.ExpressionStatement) { + break; + } + const expr = stmt.expression; + + if (expr.type !== Syntax.Literal || typeof expr.value !== "string") { + break; + } + if (expr.raw !== null && expr.raw !== undefined) { + if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") { + return true; + } + } else { + if (expr.value === "use strict") { + return true; + } + } + } + } + return false; +} + +/** + * Register scope + * @param {ScopeManager} scopeManager - scope manager + * @param {Scope} scope - scope + * @returns {void} + */ +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + + const scopes = scopeManager.__nodeToScope.get(scope.block); + + if (scopes) { + scopes.push(scope); + } else { + scopeManager.__nodeToScope.set(scope.block, [scope]); + } +} + +/** + * Should be statically + * @param {Object} def - def + * @returns {boolean} should be statically + */ +function shouldBeStatically(def) { + return ( + (def.type === Variable.ClassName) || + (def.type === Variable.Variable && def.parent.kind !== "var") + ); +} + +/** + * @class Scope + */ +class Scope { + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + + /** + * One of 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'. + * @member {String} Scope#type + */ + this.type = type; + + /** + * The scoped {@link Variable}s of this scope, as { Variable.name + * : Variable }. + * @member {Map} Scope#set + */ + this.set = new Map(); + + /** + * The tainted variables of this scope, as { Variable.name : + * boolean }. + * @member {Map} Scope#taints */ + this.taints = new Map(); + + /** + * Generally, through the lexical scoping of JS you can always know + * which variable an identifier in the source code refers to. There are + * a few exceptions to this rule. With 'global' and 'with' scopes you + * can only decide at runtime which variable a reference refers to. + * Moreover, if 'eval()' is used in a scope, it might introduce new + * bindings in this or its parent scopes. + * All those scopes are considered 'dynamic'. + * @member {boolean} Scope#dynamic + */ + this.dynamic = this.type === "global" || this.type === "with"; + + /** + * A reference to the scope-defining syntax node. + * @member {espree.Node} Scope#block + */ + this.block = block; + + /** + * The {@link Reference|references} that are not resolved with this scope. + * @member {Reference[]} Scope#through + */ + this.through = []; + + /** + * The scoped {@link Variable}s of this scope. In the case of a + * 'function' scope this includes the automatic argument arguments as + * its first element, as well as all further formal arguments. + * @member {Variable[]} Scope#variables + */ + this.variables = []; + + /** + * Any variable {@link Reference|reference} found in this scope. This + * includes occurrences of local variables as well as variables from + * parent scopes (including the global scope). For local variables + * this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the + * formal parameter in the parameter list. + * @member {Reference[]} Scope#references + */ + this.references = []; + + /** + * For 'global' and 'function' scopes, this is a self-reference. For + * other scope types this is the variableScope value of the + * parent scope. + * @member {Scope} Scope#variableScope + */ + this.variableScope = + (this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope; + + /** + * Whether this scope is created by a FunctionExpression. + * @member {boolean} Scope#functionExpressionScope + */ + this.functionExpressionScope = false; + + /** + * Whether this is a scope that contains an 'eval()' invocation. + * @member {boolean} Scope#directCallToEvalScope + */ + this.directCallToEvalScope = false; + + /** + * @member {boolean} Scope#thisFound + */ + this.thisFound = false; + + this.__left = []; + + /** + * Reference to the parent {@link Scope|scope}. + * @member {Scope} Scope#upper + */ + this.upper = upperScope; + + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective()); + + /** + * List of nested {@link Scope}s. + * @member {Scope[]} Scope#childScopes + */ + this.childScopes = []; + if (this.upper) { + this.upper.childScopes.push(this); + } + + this.__declaredVariables = scopeManager.__declaredVariables; + + registerScope(scopeManager, this); + } + + __shouldStaticallyClose(scopeManager) { + return (!this.dynamic || scopeManager.__isOptimistic()); + } + + __shouldStaticallyCloseForGlobal(ref) { + + // On global scope, let/const/class declarations should be resolved statically. + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + + const variable = this.set.get(name); + const defs = variable.defs; + + return defs.length > 0 && defs.every(shouldBeStatically); + } + + __staticCloseRef(ref) { + if (!this.__resolve(ref)) { + this.__delegateToUpperScope(ref); + } + } + + __dynamicCloseRef(ref) { + + // notify all names are through to global + let current = this; + + do { + current.through.push(ref); + current = current.upper; + } while (current); + } + + __globalCloseRef(ref) { + + // let/const/class declarations should be resolved statically. + // others should be resolved dynamically. + if (this.__shouldStaticallyCloseForGlobal(ref)) { + this.__staticCloseRef(ref); + } else { + this.__dynamicCloseRef(ref); + } + } + + __close(scopeManager) { + let closeRef; + + if (this.__shouldStaticallyClose(scopeManager)) { + closeRef = this.__staticCloseRef; + } else if (this.type !== "global") { + closeRef = this.__dynamicCloseRef; + } else { + closeRef = this.__globalCloseRef; + } + + // Try Resolving all references in this scope. + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + closeRef.call(this, ref); + } + this.__left = null; + + return this.upper; + } + + // To override by function scopes. + // References in default parameters isn't resolved to variables which are in their function body. + __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars + return true; + } + + __resolve(ref) { + const name = ref.identifier.name; + + if (!this.set.has(name)) { + return false; + } + const variable = this.set.get(name); + + if (!this.__isValidResolution(ref, variable)) { + return false; + } + variable.references.push(ref); + variable.stack = variable.stack && ref.from.variableScope === this.variableScope; + if (ref.tainted) { + variable.tainted = true; + this.taints.set(variable.name, true); + } + ref.resolved = variable; + + return true; + } + + __delegateToUpperScope(ref) { + if (this.upper) { + this.upper.__left.push(ref); + } + this.through.push(ref); + } + + __addDeclaredVariablesOfNode(variable, node) { + if (node === null || node === undefined) { + return; + } + + let variables = this.__declaredVariables.get(node); + + if (variables === null || variables === undefined) { + variables = []; + this.__declaredVariables.set(node, variables); + } + if (variables.indexOf(variable) === -1) { + variables.push(variable); + } + } + + __defineGeneric(name, set, variables, node, def) { + let variable; + + variable = set.get(name); + if (!variable) { + variable = new Variable(name, this); + set.set(name, variable); + variables.push(variable); + } + + if (def) { + variable.defs.push(def); + this.__addDeclaredVariablesOfNode(variable, def.node); + this.__addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + + __define(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.set, + this.variables, + node, + def + ); + } + } + + __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) { + + // because Array element may be null + if (!node || node.type !== Syntax.Identifier) { + return; + } + + // Specially handle like `this`. + if (node.name === "super") { + return; + } + + const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init); + + this.references.push(ref); + this.__left.push(ref); + } + + __detectEval() { + let current = this; + + this.directCallToEvalScope = true; + do { + current.dynamic = true; + current = current.upper; + } while (current); + } + + __detectThis() { + this.thisFound = true; + } + + __isClosed() { + return this.__left === null; + } + + /** + * returns resolved {Reference} + * @method Scope#resolve + * @param {Espree.Identifier} ident - identifier to be resolved. + * @returns {Reference} reference + */ + resolve(ident) { + let ref, i, iz; + + assert(this.__isClosed(), "Scope should be closed."); + assert(ident.type === Syntax.Identifier, "Target should be identifier."); + for (i = 0, iz = this.references.length; i < iz; ++i) { + ref = this.references[i]; + if (ref.identifier === ident) { + return ref; + } + } + return null; + } + + /** + * returns this scope is static + * @method Scope#isStatic + * @returns {boolean} static + */ + isStatic() { + return !this.dynamic; + } + + /** + * returns this scope has materialized arguments + * @method Scope#isArgumentsMaterialized + * @returns {boolean} arguemnts materialized + */ + isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + /** + * returns this scope has materialized `this` reference + * @method Scope#isThisMaterialized + * @returns {boolean} this materialized + */ + isThisMaterialized() { // eslint-disable-line class-methods-use-this + return true; + } + + isUsedName(name) { + if (this.set.has(name)) { + return true; + } + for (let i = 0, iz = this.through.length; i < iz; ++i) { + if (this.through[i].identifier.name === name) { + return true; + } + } + return false; + } +} + +class GlobalScope extends Scope { + constructor(scopeManager, block) { + super(scopeManager, "global", null, block, false); + this.implicit = { + set: new Map(), + variables: [], + + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + * @member {Reference[]} Scope#implicit#left + */ + left: [] + }; + } + + __close(scopeManager) { + const implicit = []; + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + implicit.push(ref.__maybeImplicitGlobal); + } + } + + // create an implicit global variable from assignment expression + for (let i = 0, iz = implicit.length; i < iz; ++i) { + const info = implicit[i]; + + this.__defineImplicit(info.pattern, + new Definition( + Variable.ImplicitGlobalVariable, + info.pattern, + info.node, + null, + null, + null + )); + + } + + this.implicit.left = this.__left; + + return super.__close(scopeManager); + } + + __defineImplicit(node, def) { + if (node && node.type === Syntax.Identifier) { + this.__defineGeneric( + node.name, + this.implicit.set, + this.implicit.variables, + node, + def + ); + } + } +} + +class ModuleScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "module", upperScope, block, false); + } +} + +class FunctionExpressionNameScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "function-expression-name", upperScope, block, false); + this.__define(block.id, + new Definition( + Variable.FunctionName, + block.id, + block, + null, + null, + null + )); + this.functionExpressionScope = true; + } +} + +class CatchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "catch", upperScope, block, false); + } +} + +class WithScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "with", upperScope, block, false); + } + + __close(scopeManager) { + if (this.__shouldStaticallyClose(scopeManager)) { + return super.__close(scopeManager); + } + + for (let i = 0, iz = this.__left.length; i < iz; ++i) { + const ref = this.__left[i]; + + ref.tainted = true; + this.__delegateToUpperScope(ref); + } + this.__left = null; + + return this.upper; + } +} + +class BlockScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "block", upperScope, block, false); + } +} + +class SwitchScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "switch", upperScope, block, false); + } +} + +class FunctionScope extends Scope { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, "function", upperScope, block, isMethodDefinition); + + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== Syntax.ArrowFunctionExpression) { + this.__defineArguments(); + } + } + + isArgumentsMaterialized() { + + // TODO(Constellation) + // We can more aggressive on this condition like this. + // + // function t() { + // // arguments of t is always hidden. + // function arguments() { + // } + // } + if (this.block.type === Syntax.ArrowFunctionExpression) { + return false; + } + + if (!this.isStatic()) { + return true; + } + + const variable = this.set.get("arguments"); + + assert(variable, "Always have arguments variable."); + return variable.tainted || variable.references.length !== 0; + } + + isThisMaterialized() { + if (!this.isStatic()) { + return true; + } + return this.thisFound; + } + + __defineArguments() { + this.__defineGeneric( + "arguments", + this.set, + this.variables, + null, + null + ); + this.taints.set("arguments", true); + } + + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + __isValidResolution(ref, variable) { + + // If `options.nodejsScope` is true, `this.block` becomes a Program node. + if (this.block.type === "Program") { + return true; + } + + const bodyStart = this.block.body.range[0]; + + // It's invalid resolution in the following case: + return !( + variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. + ); + } +} + +class ForScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "for", upperScope, block, false); + } +} + +class ClassScope extends Scope { + constructor(scopeManager, upperScope, block) { + super(scopeManager, "class", upperScope, block, false); + } +} + +module.exports = { + Scope, + GlobalScope, + ModuleScope, + FunctionExpressionNameScope, + CatchScope, + WithScope, + BlockScope, + SwitchScope, + FunctionScope, + ForScope, + ClassScope +}; + +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 82971: +/***/ (function(module) { + +"use strict"; +/* + Copyright (C) 2015 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +/** + * A Variable represents a locally scoped identifier. These include arguments to + * functions. + * @class Variable + */ +class Variable { + constructor(name, scope) { + + /** + * The variable name, as given in the source code. + * @member {String} Variable#name + */ + this.name = name; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as AST nodes. + * @member {espree.Identifier[]} Variable#identifiers + */ + this.identifiers = []; + + /** + * List of {@link Reference|references} of this variable (excluding parameter entries) + * in its defining scope and all nested scopes. For defining + * occurrences only see {@link Variable#defs}. + * @member {Reference[]} Variable#references + */ + this.references = []; + + /** + * List of defining occurrences of this variable (like in 'var ...' + * statements or as parameter), as custom objects. + * @member {Definition[]} Variable#defs + */ + this.defs = []; + + this.tainted = false; + + /** + * Whether this is a stack variable. + * @member {boolean} Variable#stack + */ + this.stack = true; + + /** + * Reference to the enclosing Scope. + * @member {Scope} Variable#scope + */ + this.scope = scope; + } +} + +Variable.CatchClause = "CatchClause"; +Variable.Parameter = "Parameter"; +Variable.FunctionName = "FunctionName"; +Variable.ClassName = "ClassName"; +Variable.Variable = "Variable"; +Variable.ImportBinding = "ImportBinding"; +Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable"; + +module.exports = Variable; + +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 81217: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +/* + Copyright (C) 2014 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +(function () { + 'use strict'; + + var estraverse = __webpack_require__(50165); + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; + } + + function Visitor(visitor, options) { + options = options || {}; + + this.__visitor = visitor || this; + this.__childVisitorKeys = options.childVisitorKeys + ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) + : estraverse.VisitorKeys; + if (options.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof options.fallback === 'function') { + this.__fallback = options.fallback; + } + } + + /* Default method for visiting children. + * When you need to call default visiting operation inside custom visiting + * operation, you can use it with `this.visitChildren(node)`. + */ + Visitor.prototype.visitChildren = function (node) { + var type, children, i, iz, j, jz, child; + + if (node == null) { + return; + } + + type = node.type || estraverse.Syntax.Property; + + children = this.__childVisitorKeys[type]; + if (!children) { + if (this.__fallback) { + children = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + type + '.'); + } + } + + for (i = 0, iz = children.length; i < iz; ++i) { + child = node[children[i]]; + if (child) { + if (Array.isArray(child)) { + for (j = 0, jz = child.length; j < jz; ++j) { + if (child[j]) { + if (isNode(child[j]) || isProperty(type, children[i])) { + this.visit(child[j]); + } + } + } + } else if (isNode(child)) { + this.visit(child); + } + } + } + }; + + /* Dispatching node. */ + Visitor.prototype.visit = function (node) { + var type; + + if (node == null) { + return; + } + + type = node.type || estraverse.Syntax.Property; + if (this.__visitor[type]) { + this.__visitor[type].call(this, node); + return; + } + this.visitChildren(node); + }; + + exports.version = __webpack_require__(12166).version; + exports.Visitor = Visitor; + exports.visit = function (node, visitor, options) { + var v = new Visitor(visitor, options); + v.visit(node); + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 50165: +/***/ (function(__unused_webpack_module, exports) { + +/* + Copyright (C) 2012-2013 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/*jslint vars:false, bitwise:true*/ +/*jshint indent:4*/ +/*global exports:true*/ +(function clone(exports) { + 'use strict'; + + var Syntax, + VisitorOption, + VisitorKeys, + BREAK, + SKIP, + REMOVE; + + function deepCopy(obj) { + var ret = {}, key, val; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + val = obj[key]; + if (typeof val === 'object' && val !== null) { + ret[key] = deepCopy(val); + } else { + ret[key] = val; + } + } + } + return ret; + } + + // based on LLVM libc++ upper_bound / lower_bound + // MIT License + + function upperBound(array, func) { + var diff, len, i, current; + + len = array.length; + i = 0; + + while (len) { + diff = len >>> 1; + current = i + diff; + if (func(array[current])) { + len = diff; + } else { + i = current + 1; + len -= diff + 1; + } + } + return i; + } + + Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ChainExpression: 'ChainExpression', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. + ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DirectiveStatement: 'DirectiveStatement', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + ModuleSpecifier: 'ModuleSpecifier', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + VisitorKeys = { + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. + BlockStatement: ['body'], + BinaryExpression: ['left', 'right'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ChainExpression: ['expression'], + ClassBody: ['body'], + ClassDeclaration: ['id', 'superClass', 'body'], + ClassExpression: ['id', 'superClass', 'body'], + ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. + ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['source'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], + ExportSpecifier: ['exported', 'local'], + ExpressionStatement: ['expression'], + ForStatement: ['init', 'test', 'update', 'body'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], + ImportDeclaration: ['specifiers', 'source'], + ImportDefaultSpecifier: ['local'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + Literal: [], + LabeledStatement: ['label', 'body'], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['key', 'value'], + ModuleSpecifier: [], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + Program: ['body'], + Property: ['key', 'value'], + RestElement: [ 'argument' ], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + Super: [], + SwitchStatement: ['discriminant', 'cases'], + SwitchCase: ['test', 'consequent'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + WithStatement: ['object', 'body'], + YieldExpression: ['argument'] + }; + + // unique id + BREAK = {}; + SKIP = {}; + REMOVE = {}; + + VisitorOption = { + Break: BREAK, + Skip: SKIP, + Remove: REMOVE + }; + + function Reference(parent, key) { + this.parent = parent; + this.key = key; + } + + Reference.prototype.replace = function replace(node) { + this.parent[this.key] = node; + }; + + Reference.prototype.remove = function remove() { + if (Array.isArray(this.parent)) { + this.parent.splice(this.key, 1); + return true; + } else { + this.replace(null); + return false; + } + }; + + function Element(node, path, wrap, ref) { + this.node = node; + this.path = path; + this.wrap = wrap; + this.ref = ref; + } + + function Controller() { } + + // API: + // return property path array from root to current node + Controller.prototype.path = function path() { + var i, iz, j, jz, result, element; + + function addToPath(result, path) { + if (Array.isArray(path)) { + for (j = 0, jz = path.length; j < jz; ++j) { + result.push(path[j]); + } + } else { + result.push(path); + } + } + + // root node + if (!this.__current.path) { + return null; + } + + // first node is sentinel, second node is root element + result = []; + for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { + element = this.__leavelist[i]; + addToPath(result, element.path); + } + addToPath(result, this.__current.path); + return result; + }; + + // API: + // return type of current node + Controller.prototype.type = function () { + var node = this.current(); + return node.type || this.__current.wrap; + }; + + // API: + // return array of parent elements + Controller.prototype.parents = function parents() { + var i, iz, result; + + // first node is sentinel + result = []; + for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { + result.push(this.__leavelist[i].node); + } + + return result; + }; + + // API: + // return current node + Controller.prototype.current = function current() { + return this.__current.node; + }; + + Controller.prototype.__execute = function __execute(callback, element) { + var previous, result; + + result = undefined; + + previous = this.__current; + this.__current = element; + this.__state = null; + if (callback) { + result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); + } + this.__current = previous; + + return result; + }; + + // API: + // notify control skip / break + Controller.prototype.notify = function notify(flag) { + this.__state = flag; + }; + + // API: + // skip child nodes of current node + Controller.prototype.skip = function () { + this.notify(SKIP); + }; + + // API: + // break traversals + Controller.prototype['break'] = function () { + this.notify(BREAK); + }; + + // API: + // remove node + Controller.prototype.remove = function () { + this.notify(REMOVE); + }; + + Controller.prototype.__initialize = function(root, visitor) { + this.visitor = visitor; + this.root = root; + this.__worklist = []; + this.__leavelist = []; + this.__current = null; + this.__state = null; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + + this.__keys = VisitorKeys; + if (visitor.keys) { + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); + } + }; + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; + } + + function candidateExistsInLeaveList(leavelist, candidate) { + for (var i = leavelist.length - 1; i >= 0; --i) { + if (leavelist[i].node === candidate) { + return true; + } + } + return false; + } + + Controller.prototype.traverse = function traverse(root, visitor) { + var worklist, + leavelist, + element, + node, + nodeType, + ret, + key, + current, + current2, + candidates, + candidate, + sentinel; + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + worklist.push(new Element(root, null, null, null)); + leavelist.push(new Element(null, null, null, null)); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + ret = this.__execute(visitor.leave, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + continue; + } + + if (element.node) { + + ret = this.__execute(visitor.enter, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || ret === SKIP) { + continue; + } + + node = element.node; + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + + if (candidateExistsInLeaveList(leavelist, candidate[current2])) { + continue; + } + + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', null); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, null); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + if (candidateExistsInLeaveList(leavelist, candidate)) { + continue; + } + + worklist.push(new Element(candidate, key, null, null)); + } + } + } + } + }; + + Controller.prototype.replace = function replace(root, visitor) { + var worklist, + leavelist, + node, + nodeType, + target, + element, + current, + current2, + candidates, + candidate, + sentinel, + outer, + key; + + function removeElem(element) { + var i, + key, + nextElem, + parent; + + if (element.ref.remove()) { + // When the reference is an element of an array. + key = element.ref.key; + parent = element.ref.parent; + + // If removed from array, then decrease following items' keys. + i = worklist.length; + while (i--) { + nextElem = worklist[i]; + if (nextElem.ref && nextElem.ref.parent === parent) { + if (nextElem.ref.key < key) { + break; + } + --nextElem.ref.key; + } + } + } + } + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + outer = { + root: root + }; + element = new Element(root, null, null, new Reference(outer, 'root')); + worklist.push(element); + leavelist.push(element); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + target = this.__execute(visitor.leave, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + continue; + } + + target = this.__execute(visitor.enter, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + element.node = target; + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + element.node = null; + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + + // node may be null + node = element.node; + if (!node) { + continue; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || target === SKIP) { + continue; + } + + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, new Reference(node, key))); + } + } + } + + return outer.root; + }; + + function traverse(root, visitor) { + var controller = new Controller(); + return controller.traverse(root, visitor); + } + + function replace(root, visitor) { + var controller = new Controller(); + return controller.replace(root, visitor); + } + + function extendCommentRange(comment, tokens) { + var target; + + target = upperBound(tokens, function search(token) { + return token.range[0] > comment.range[0]; + }); + + comment.extendedRange = [comment.range[0], comment.range[1]]; + + if (target !== tokens.length) { + comment.extendedRange[1] = tokens[target].range[0]; + } + + target -= 1; + if (target >= 0) { + comment.extendedRange[0] = tokens[target].range[1]; + } + + return comment; + } + + function attachComments(tree, providedComments, tokens) { + // At first, we should calculate extended comment ranges. + var comments = [], comment, len, i, cursor; + + if (!tree.range) { + throw new Error('attachComments needs range information'); + } + + // tokens array is empty, we attach comments to tree as 'leadingComments' + if (!tokens.length) { + if (providedComments.length) { + for (i = 0, len = providedComments.length; i < len; i += 1) { + comment = deepCopy(providedComments[i]); + comment.extendedRange = [0, tree.range[0]]; + comments.push(comment); + } + tree.leadingComments = comments; + } + return tree; + } + + for (i = 0, len = providedComments.length; i < len; i += 1) { + comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); + } + + // This is based on John Freeman's implementation. + cursor = 0; + traverse(tree, { + enter: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (comment.extendedRange[1] > node.range[0]) { + break; + } + + if (comment.extendedRange[1] === node.range[0]) { + if (!node.leadingComments) { + node.leadingComments = []; + } + node.leadingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + cursor = 0; + traverse(tree, { + leave: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (node.range[1] < comment.extendedRange[0]) { + break; + } + + if (node.range[1] === comment.extendedRange[0]) { + if (!node.trailingComments) { + node.trailingComments = []; + } + node.trailingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + return tree; + } + + exports.Syntax = Syntax; + exports.traverse = traverse; + exports.replace = replace; + exports.attachComments = attachComments; + exports.VisitorKeys = VisitorKeys; + exports.VisitorOption = VisitorOption; + exports.Controller = Controller; + exports.cloneEnvironment = function () { return clone({}); }; + + return exports; +}(exports)); +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 18350: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +/* + Copyright (C) 2012-2013 Yusuke Suzuki + Copyright (C) 2012 Ariya Hidayat + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +/*jslint vars:false, bitwise:true*/ +/*jshint indent:4*/ +/*global exports:true*/ +(function clone(exports) { + 'use strict'; + + var Syntax, + VisitorOption, + VisitorKeys, + BREAK, + SKIP, + REMOVE; + + function deepCopy(obj) { + var ret = {}, key, val; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + val = obj[key]; + if (typeof val === 'object' && val !== null) { + ret[key] = deepCopy(val); + } else { + ret[key] = val; + } + } + } + return ret; + } + + // based on LLVM libc++ upper_bound / lower_bound + // MIT License + + function upperBound(array, func) { + var diff, len, i, current; + + len = array.length; + i = 0; + + while (len) { + diff = len >>> 1; + current = i + diff; + if (func(array[current])) { + len = diff; + } else { + i = current + 1; + len -= diff + 1; + } + } + return i; + } + + Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7. + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7. + ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7. + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DirectiveStatement: 'DirectiveStatement', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7. + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportExpression: 'ImportExpression', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + ModuleSpecifier: 'ModuleSpecifier', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + VisitorKeys = { + AssignmentExpression: ['left', 'right'], + AssignmentPattern: ['left', 'right'], + ArrayExpression: ['elements'], + ArrayPattern: ['elements'], + ArrowFunctionExpression: ['params', 'body'], + AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7. + BlockStatement: ['body'], + BinaryExpression: ['left', 'right'], + BreakStatement: ['label'], + CallExpression: ['callee', 'arguments'], + CatchClause: ['param', 'body'], + ClassBody: ['body'], + ClassDeclaration: ['id', 'superClass', 'body'], + ClassExpression: ['id', 'superClass', 'body'], + ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7. + ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + ConditionalExpression: ['test', 'consequent', 'alternate'], + ContinueStatement: ['label'], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ['body', 'test'], + EmptyStatement: [], + ExportAllDeclaration: ['source'], + ExportDefaultDeclaration: ['declaration'], + ExportNamedDeclaration: ['declaration', 'specifiers', 'source'], + ExportSpecifier: ['exported', 'local'], + ExpressionStatement: ['expression'], + ForStatement: ['init', 'test', 'update', 'body'], + ForInStatement: ['left', 'right', 'body'], + ForOfStatement: ['left', 'right', 'body'], + FunctionDeclaration: ['id', 'params', 'body'], + FunctionExpression: ['id', 'params', 'body'], + GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7. + Identifier: [], + IfStatement: ['test', 'consequent', 'alternate'], + ImportExpression: ['source'], + ImportDeclaration: ['specifiers', 'source'], + ImportDefaultSpecifier: ['local'], + ImportNamespaceSpecifier: ['local'], + ImportSpecifier: ['imported', 'local'], + Literal: [], + LabeledStatement: ['label', 'body'], + LogicalExpression: ['left', 'right'], + MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], + MethodDefinition: ['key', 'value'], + ModuleSpecifier: [], + NewExpression: ['callee', 'arguments'], + ObjectExpression: ['properties'], + ObjectPattern: ['properties'], + Program: ['body'], + Property: ['key', 'value'], + RestElement: [ 'argument' ], + ReturnStatement: ['argument'], + SequenceExpression: ['expressions'], + SpreadElement: ['argument'], + Super: [], + SwitchStatement: ['discriminant', 'cases'], + SwitchCase: ['test', 'consequent'], + TaggedTemplateExpression: ['tag', 'quasi'], + TemplateElement: [], + TemplateLiteral: ['quasis', 'expressions'], + ThisExpression: [], + ThrowStatement: ['argument'], + TryStatement: ['block', 'handler', 'finalizer'], + UnaryExpression: ['argument'], + UpdateExpression: ['argument'], + VariableDeclaration: ['declarations'], + VariableDeclarator: ['id', 'init'], + WhileStatement: ['test', 'body'], + WithStatement: ['object', 'body'], + YieldExpression: ['argument'] + }; + + // unique id + BREAK = {}; + SKIP = {}; + REMOVE = {}; + + VisitorOption = { + Break: BREAK, + Skip: SKIP, + Remove: REMOVE + }; + + function Reference(parent, key) { + this.parent = parent; + this.key = key; + } + + Reference.prototype.replace = function replace(node) { + this.parent[this.key] = node; + }; + + Reference.prototype.remove = function remove() { + if (Array.isArray(this.parent)) { + this.parent.splice(this.key, 1); + return true; + } else { + this.replace(null); + return false; + } + }; + + function Element(node, path, wrap, ref) { + this.node = node; + this.path = path; + this.wrap = wrap; + this.ref = ref; + } + + function Controller() { } + + // API: + // return property path array from root to current node + Controller.prototype.path = function path() { + var i, iz, j, jz, result, element; + + function addToPath(result, path) { + if (Array.isArray(path)) { + for (j = 0, jz = path.length; j < jz; ++j) { + result.push(path[j]); + } + } else { + result.push(path); + } + } + + // root node + if (!this.__current.path) { + return null; + } + + // first node is sentinel, second node is root element + result = []; + for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { + element = this.__leavelist[i]; + addToPath(result, element.path); + } + addToPath(result, this.__current.path); + return result; + }; + + // API: + // return type of current node + Controller.prototype.type = function () { + var node = this.current(); + return node.type || this.__current.wrap; + }; + + // API: + // return array of parent elements + Controller.prototype.parents = function parents() { + var i, iz, result; + + // first node is sentinel + result = []; + for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { + result.push(this.__leavelist[i].node); + } + + return result; + }; + + // API: + // return current node + Controller.prototype.current = function current() { + return this.__current.node; + }; + + Controller.prototype.__execute = function __execute(callback, element) { + var previous, result; + + result = undefined; + + previous = this.__current; + this.__current = element; + this.__state = null; + if (callback) { + result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); + } + this.__current = previous; + + return result; + }; + + // API: + // notify control skip / break + Controller.prototype.notify = function notify(flag) { + this.__state = flag; + }; + + // API: + // skip child nodes of current node + Controller.prototype.skip = function () { + this.notify(SKIP); + }; + + // API: + // break traversals + Controller.prototype['break'] = function () { + this.notify(BREAK); + }; + + // API: + // remove node + Controller.prototype.remove = function () { + this.notify(REMOVE); + }; + + Controller.prototype.__initialize = function(root, visitor) { + this.visitor = visitor; + this.root = root; + this.__worklist = []; + this.__leavelist = []; + this.__current = null; + this.__state = null; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = Object.keys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + + this.__keys = VisitorKeys; + if (visitor.keys) { + this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); + } + }; + + function isNode(node) { + if (node == null) { + return false; + } + return typeof node === 'object' && typeof node.type === 'string'; + } + + function isProperty(nodeType, key) { + return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; + } + + Controller.prototype.traverse = function traverse(root, visitor) { + var worklist, + leavelist, + element, + node, + nodeType, + ret, + key, + current, + current2, + candidates, + candidate, + sentinel; + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + worklist.push(new Element(root, null, null, null)); + leavelist.push(new Element(null, null, null, null)); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + ret = this.__execute(visitor.leave, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + continue; + } + + if (element.node) { + + ret = this.__execute(visitor.enter, element); + + if (this.__state === BREAK || ret === BREAK) { + return; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || ret === SKIP) { + continue; + } + + node = element.node; + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', null); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, null); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, null)); + } + } + } + } + }; + + Controller.prototype.replace = function replace(root, visitor) { + var worklist, + leavelist, + node, + nodeType, + target, + element, + current, + current2, + candidates, + candidate, + sentinel, + outer, + key; + + function removeElem(element) { + var i, + key, + nextElem, + parent; + + if (element.ref.remove()) { + // When the reference is an element of an array. + key = element.ref.key; + parent = element.ref.parent; + + // If removed from array, then decrease following items' keys. + i = worklist.length; + while (i--) { + nextElem = worklist[i]; + if (nextElem.ref && nextElem.ref.parent === parent) { + if (nextElem.ref.key < key) { + break; + } + --nextElem.ref.key; + } + } + } + } + + this.__initialize(root, visitor); + + sentinel = {}; + + // reference + worklist = this.__worklist; + leavelist = this.__leavelist; + + // initialize + outer = { + root: root + }; + element = new Element(root, null, null, new Reference(outer, 'root')); + worklist.push(element); + leavelist.push(element); + + while (worklist.length) { + element = worklist.pop(); + + if (element === sentinel) { + element = leavelist.pop(); + + target = this.__execute(visitor.leave, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + continue; + } + + target = this.__execute(visitor.enter, element); + + // node may be replaced with null, + // so distinguish between undefined and null in this place + if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { + // replace + element.ref.replace(target); + element.node = target; + } + + if (this.__state === REMOVE || target === REMOVE) { + removeElem(element); + element.node = null; + } + + if (this.__state === BREAK || target === BREAK) { + return outer.root; + } + + // node may be null + node = element.node; + if (!node) { + continue; + } + + worklist.push(sentinel); + leavelist.push(element); + + if (this.__state === SKIP || target === SKIP) { + continue; + } + + nodeType = node.type || element.wrap; + candidates = this.__keys[nodeType]; + if (!candidates) { + if (this.__fallback) { + candidates = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + nodeType + '.'); + } + } + + current = candidates.length; + while ((current -= 1) >= 0) { + key = candidates[current]; + candidate = node[key]; + if (!candidate) { + continue; + } + + if (Array.isArray(candidate)) { + current2 = candidate.length; + while ((current2 -= 1) >= 0) { + if (!candidate[current2]) { + continue; + } + if (isProperty(nodeType, candidates[current])) { + element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); + } else if (isNode(candidate[current2])) { + element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); + } else { + continue; + } + worklist.push(element); + } + } else if (isNode(candidate)) { + worklist.push(new Element(candidate, key, null, new Reference(node, key))); + } + } + } + + return outer.root; + }; + + function traverse(root, visitor) { + var controller = new Controller(); + return controller.traverse(root, visitor); + } + + function replace(root, visitor) { + var controller = new Controller(); + return controller.replace(root, visitor); + } + + function extendCommentRange(comment, tokens) { + var target; + + target = upperBound(tokens, function search(token) { + return token.range[0] > comment.range[0]; + }); + + comment.extendedRange = [comment.range[0], comment.range[1]]; + + if (target !== tokens.length) { + comment.extendedRange[1] = tokens[target].range[0]; + } + + target -= 1; + if (target >= 0) { + comment.extendedRange[0] = tokens[target].range[1]; + } + + return comment; + } + + function attachComments(tree, providedComments, tokens) { + // At first, we should calculate extended comment ranges. + var comments = [], comment, len, i, cursor; + + if (!tree.range) { + throw new Error('attachComments needs range information'); + } + + // tokens array is empty, we attach comments to tree as 'leadingComments' + if (!tokens.length) { + if (providedComments.length) { + for (i = 0, len = providedComments.length; i < len; i += 1) { + comment = deepCopy(providedComments[i]); + comment.extendedRange = [0, tree.range[0]]; + comments.push(comment); + } + tree.leadingComments = comments; + } + return tree; + } + + for (i = 0, len = providedComments.length; i < len; i += 1) { + comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); + } + + // This is based on John Freeman's implementation. + cursor = 0; + traverse(tree, { + enter: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (comment.extendedRange[1] > node.range[0]) { + break; + } + + if (comment.extendedRange[1] === node.range[0]) { + if (!node.leadingComments) { + node.leadingComments = []; + } + node.leadingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + cursor = 0; + traverse(tree, { + leave: function (node) { + var comment; + + while (cursor < comments.length) { + comment = comments[cursor]; + if (node.range[1] < comment.extendedRange[0]) { + break; + } + + if (node.range[1] === comment.extendedRange[0]) { + if (!node.trailingComments) { + node.trailingComments = []; + } + node.trailingComments.push(comment); + comments.splice(cursor, 1); + } else { + cursor += 1; + } + } + + // already out of owned node + if (cursor === comments.length) { + return VisitorOption.Break; + } + + if (comments[cursor].extendedRange[0] > node.range[1]) { + return VisitorOption.Skip; + } + } + }); + + return tree; + } + + exports.version = (__webpack_require__(15535)/* .version */ .i8); + exports.Syntax = Syntax; + exports.traverse = traverse; + exports.replace = replace; + exports.attachComments = attachComments; + exports.VisitorKeys = VisitorKeys; + exports.VisitorOption = VisitorOption; + exports.Controller = Controller; + exports.cloneEnvironment = function () { return clone({}); }; + + return exports; +}(exports)); +/* vim: set sw=4 ts=4 et tw=80 : */ + + +/***/ }), + +/***/ 86140: +/***/ (function(module) { + +module.exports = function (glob, opts) { + if (typeof glob !== 'string') { + throw new TypeError('Expected a string'); + } + + var str = String(glob); + + // The regexp we are building, as a string. + var reStr = ""; + + // Whether we are matching so called "extended" globs (like bash) and should + // support single character matching, matching ranges of characters, group + // matching, etc. + var extended = opts ? !!opts.extended : false; + + // When globstar is _false_ (default), '/foo/*' is translated a regexp like + // '^\/foo\/.*$' which will match any string beginning with '/foo/' + // When globstar is _true_, '/foo/*' is translated to regexp like + // '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT + // which does not have a '/' to the right of it. + // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but + // these will not '/foo/bar/baz', '/foo/bar/baz.txt' + // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when + // globstar is _false_ + var globstar = opts ? !!opts.globstar : false; + + // If we are doing extended matching, this boolean is true when we are inside + // a group (eg {*.html,*.js}), and false otherwise. + var inGroup = false; + + // RegExp flags (eg "i" ) to pass in to RegExp constructor. + var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : ""; + + var c; + for (var i = 0, len = str.length; i < len; i++) { + c = str[i]; + + switch (c) { + case "/": + case "$": + case "^": + case "+": + case ".": + case "(": + case ")": + case "=": + case "!": + case "|": + reStr += "\\" + c; + break; + + case "?": + if (extended) { + reStr += "."; + break; + } + + case "[": + case "]": + if (extended) { + reStr += c; + break; + } + + case "{": + if (extended) { + inGroup = true; + reStr += "("; + break; + } + + case "}": + if (extended) { + inGroup = false; + reStr += ")"; + break; + } + + case ",": + if (inGroup) { + reStr += "|"; + break; + } + reStr += "\\" + c; + break; + + case "*": + // Move over all consecutive "*"'s. + // Also store the previous and next characters + var prevChar = str[i - 1]; + var starCount = 1; + while(str[i + 1] === "*") { + starCount++; + i++; + } + var nextChar = str[i + 1]; + + if (!globstar) { + // globstar is disabled, so treat any number of "*" as one + reStr += ".*"; + } else { + // globstar is enabled, so determine if this is a globstar segment + var isGlobstar = starCount > 1 // multiple "*"'s + && (prevChar === "/" || prevChar === undefined) // from the start of the segment + && (nextChar === "/" || nextChar === undefined) // to the end of the segment + + if (isGlobstar) { + // it's a globstar, so match zero or more path segments + reStr += "((?:[^/]*(?:\/|$))*)"; + i++; // move over the "/" + } else { + // it's not a globstar, so only match one path segment + reStr += "([^/]*)"; + } + } + break; + + default: + reStr += c; + } + } + + // When regexp 'g' flag is specified don't + // constrain the regular expression with ^ & $ + if (!flags || !~flags.indexOf('g')) { + reStr = "^" + reStr + "$"; + } + + return new RegExp(reStr, flags); +}; + + +/***/ }), + +/***/ 89132: +/***/ (function(module) { + +"use strict"; + + +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__: getPrototypeOf(obj) } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} + + +/***/ }), + +/***/ 90552: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var fs = __webpack_require__(57147) +var polyfills = __webpack_require__(11290) +var legacy = __webpack_require__(54410) +var clone = __webpack_require__(89132) + +var util = __webpack_require__(73837) + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + __webpack_require__(39491).equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + 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 go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readdir(path, options, cb) + + function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + }) + } + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } + } + // call retry to make sure we're actively processing the queue + retry() +} + +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } + + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} + + +/***/ }), + +/***/ 54410: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var Stream = (__webpack_require__(12781).Stream) + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} + + +/***/ }), + +/***/ 11290: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var constants = __webpack_require__(22057) + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// 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 + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} + + +/***/ }), + +/***/ 15235: +/***/ (function(module) { + +"use strict"; + + +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 + } +} + + +/***/ }), + +/***/ 54983: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); +exports.Z = void 0; + +const { + stringHints, + numberHints +} = __webpack_require__(79926); +/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ + +/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ + +/** @typedef {import("./validate").Schema} Schema */ + +/** @typedef {import("./validate").ValidationErrorConfiguration} ValidationErrorConfiguration */ + +/** @typedef {import("./validate").PostFormatter} PostFormatter */ + +/** @typedef {import("./validate").SchemaUtilErrorObject} SchemaUtilErrorObject */ + +/** @enum {number} */ + + +const SPECIFICITY = { + type: 1, + not: 1, + oneOf: 1, + anyOf: 1, + if: 1, + enum: 1, + const: 1, + instanceof: 1, + required: 2, + pattern: 2, + patternRequired: 2, + format: 2, + formatMinimum: 2, + formatMaximum: 2, + minimum: 2, + exclusiveMinimum: 2, + maximum: 2, + exclusiveMaximum: 2, + multipleOf: 2, + uniqueItems: 2, + contains: 2, + minLength: 2, + maxLength: 2, + minItems: 2, + maxItems: 2, + minProperties: 2, + maxProperties: 2, + dependencies: 2, + propertyNames: 2, + additionalItems: 2, + additionalProperties: 2, + absolutePath: 2 +}; +/** + * + * @param {Array} array + * @param {(item: SchemaUtilErrorObject) => number} fn + * @returns {Array} + */ + +function filterMax(array, fn) { + const evaluatedMax = array.reduce((max, item) => Math.max(max, fn(item)), 0); + return array.filter(item => fn(item) === evaluatedMax); +} +/** + * + * @param {Array} children + * @returns {Array} + */ + + +function filterChildren(children) { + let newChildren = children; + newChildren = filterMax(newChildren, + /** + * + * @param {SchemaUtilErrorObject} error + * @returns {number} + */ + error => error.dataPath ? error.dataPath.length : 0); + newChildren = filterMax(newChildren, + /** + * @param {SchemaUtilErrorObject} error + * @returns {number} + */ + error => SPECIFICITY[ + /** @type {keyof typeof SPECIFICITY} */ + error.keyword] || 2); + return newChildren; +} +/** + * Find all children errors + * @param {Array} children + * @param {Array} schemaPaths + * @return {number} returns index of first child + */ + + +function findAllChildren(children, schemaPaths) { + let i = children.length - 1; + + const predicate = + /** + * @param {string} schemaPath + * @returns {boolean} + */ + schemaPath => children[i].schemaPath.indexOf(schemaPath) !== 0; + + while (i > -1 && !schemaPaths.every(predicate)) { + if (children[i].keyword === "anyOf" || children[i].keyword === "oneOf") { + const refs = extractRefs(children[i]); + const childrenStart = findAllChildren(children.slice(0, i), refs.concat(children[i].schemaPath)); + i = childrenStart - 1; + } else { + i -= 1; + } + } + + return i + 1; +} +/** + * Extracts all refs from schema + * @param {SchemaUtilErrorObject} error + * @return {Array} + */ + + +function extractRefs(error) { + const { + schema + } = error; + + if (!Array.isArray(schema)) { + return []; + } + + return schema.map(({ + $ref + }) => $ref).filter(s => s); +} +/** + * Groups children by their first level parent (assuming that error is root) + * @param {Array} children + * @return {Array} + */ + + +function groupChildrenByFirstChild(children) { + const result = []; + let i = children.length - 1; + + while (i > 0) { + const child = children[i]; + + if (child.keyword === "anyOf" || child.keyword === "oneOf") { + const refs = extractRefs(child); + const childrenStart = findAllChildren(children.slice(0, i), refs.concat(child.schemaPath)); + + if (childrenStart !== i) { + result.push(Object.assign({}, child, { + children: children.slice(childrenStart, i) + })); + i = childrenStart; + } else { + result.push(child); + } + } else { + result.push(child); + } + + i -= 1; + } + + if (i === 0) { + result.push(children[i]); + } + + return result.reverse(); +} +/** + * @param {string} str + * @param {string} prefix + * @returns {string} + */ + + +function indent(str, prefix) { + return str.replace(/\n(?!$)/g, `\n${prefix}`); +} +/** + * @param {Schema} schema + * @returns {schema is (Schema & {not: Schema})} + */ + + +function hasNotInSchema(schema) { + return !!schema.not; +} +/** + * @param {Schema} schema + * @return {Schema} + */ + + +function findFirstTypedSchema(schema) { + if (hasNotInSchema(schema)) { + return findFirstTypedSchema(schema.not); + } + + return schema; +} +/** + * @param {Schema} schema + * @return {boolean} + */ + + +function canApplyNot(schema) { + const typedSchema = findFirstTypedSchema(schema); + return likeNumber(typedSchema) || likeInteger(typedSchema) || likeString(typedSchema) || likeNull(typedSchema) || likeBoolean(typedSchema); +} +/** + * @param {any} maybeObj + * @returns {boolean} + */ + + +function isObject(maybeObj) { + return typeof maybeObj === "object" && maybeObj !== null; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeNumber(schema) { + return schema.type === "number" || typeof schema.minimum !== "undefined" || typeof schema.exclusiveMinimum !== "undefined" || typeof schema.maximum !== "undefined" || typeof schema.exclusiveMaximum !== "undefined" || typeof schema.multipleOf !== "undefined"; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeInteger(schema) { + return schema.type === "integer" || typeof schema.minimum !== "undefined" || typeof schema.exclusiveMinimum !== "undefined" || typeof schema.maximum !== "undefined" || typeof schema.exclusiveMaximum !== "undefined" || typeof schema.multipleOf !== "undefined"; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeString(schema) { + return schema.type === "string" || typeof schema.minLength !== "undefined" || typeof schema.maxLength !== "undefined" || typeof schema.pattern !== "undefined" || typeof schema.format !== "undefined" || typeof schema.formatMinimum !== "undefined" || typeof schema.formatMaximum !== "undefined"; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeBoolean(schema) { + return schema.type === "boolean"; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeArray(schema) { + return schema.type === "array" || typeof schema.minItems === "number" || typeof schema.maxItems === "number" || typeof schema.uniqueItems !== "undefined" || typeof schema.items !== "undefined" || typeof schema.additionalItems !== "undefined" || typeof schema.contains !== "undefined"; +} +/** + * @param {Schema & {patternRequired?: Array}} schema + * @returns {boolean} + */ + + +function likeObject(schema) { + return schema.type === "object" || typeof schema.minProperties !== "undefined" || typeof schema.maxProperties !== "undefined" || typeof schema.required !== "undefined" || typeof schema.properties !== "undefined" || typeof schema.patternProperties !== "undefined" || typeof schema.additionalProperties !== "undefined" || typeof schema.dependencies !== "undefined" || typeof schema.propertyNames !== "undefined" || typeof schema.patternRequired !== "undefined"; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeNull(schema) { + return schema.type === "null"; +} +/** + * @param {string} type + * @returns {string} + */ + + +function getArticle(type) { + if (/^[aeiou]/i.test(type)) { + return "an"; + } + + return "a"; +} +/** + * @param {Schema=} schema + * @returns {string} + */ + + +function getSchemaNonTypes(schema) { + if (!schema) { + return ""; + } + + if (!schema.type) { + if (likeNumber(schema) || likeInteger(schema)) { + return " | should be any non-number"; + } + + if (likeString(schema)) { + return " | should be any non-string"; + } + + if (likeArray(schema)) { + return " | should be any non-array"; + } + + if (likeObject(schema)) { + return " | should be any non-object"; + } + } + + return ""; +} +/** + * @param {Array} hints + * @returns {string} + */ + + +function formatHints(hints) { + return hints.length > 0 ? `(${hints.join(", ")})` : ""; +} +/** + * @param {Schema} schema + * @param {boolean} logic + * @returns {string[]} + */ + + +function getHints(schema, logic) { + if (likeNumber(schema) || likeInteger(schema)) { + return numberHints(schema, logic); + } else if (likeString(schema)) { + return stringHints(schema, logic); + } + + return []; +} + +class ValidationError extends Error { + /** + * @param {Array} errors + * @param {Schema} schema + * @param {ValidationErrorConfiguration} configuration + */ + constructor(errors, schema, configuration = {}) { + super(); + /** @type {string} */ + + this.name = "ValidationError"; + /** @type {Array} */ + + this.errors = errors; + /** @type {Schema} */ + + this.schema = schema; + let headerNameFromSchema; + let baseDataPathFromSchema; + + if (schema.title && (!configuration.name || !configuration.baseDataPath)) { + const splittedTitleFromSchema = schema.title.match(/^(.+) (.+)$/); + + if (splittedTitleFromSchema) { + if (!configuration.name) { + [, headerNameFromSchema] = splittedTitleFromSchema; + } + + if (!configuration.baseDataPath) { + [,, baseDataPathFromSchema] = splittedTitleFromSchema; + } + } + } + /** @type {string} */ + + + this.headerName = configuration.name || headerNameFromSchema || "Object"; + /** @type {string} */ + + this.baseDataPath = configuration.baseDataPath || baseDataPathFromSchema || "configuration"; + /** @type {PostFormatter | null} */ + + this.postFormatter = configuration.postFormatter || null; + const header = `Invalid ${this.baseDataPath} object. ${this.headerName} has been initialized using ${getArticle(this.baseDataPath)} ${this.baseDataPath} object that does not match the API schema.\n`; + /** @type {string} */ + + this.message = `${header}${this.formatValidationErrors(errors)}`; + Error.captureStackTrace(this, this.constructor); + } + /** + * @param {string} path + * @returns {Schema} + */ + + + getSchemaPart(path) { + const newPath = path.split("/"); + let schemaPart = this.schema; + + for (let i = 1; i < newPath.length; i++) { + const inner = schemaPart[ + /** @type {keyof Schema} */ + newPath[i]]; + + if (!inner) { + break; + } + + schemaPart = inner; + } + + return schemaPart; + } + /** + * @param {Schema} schema + * @param {boolean} logic + * @param {Array} prevSchemas + * @returns {string} + */ + + + formatSchema(schema, logic = true, prevSchemas = []) { + let newLogic = logic; + + const formatInnerSchema = + /** + * + * @param {Object} innerSchema + * @param {boolean=} addSelf + * @returns {string} + */ + (innerSchema, addSelf) => { + if (!addSelf) { + return this.formatSchema(innerSchema, newLogic, prevSchemas); + } + + if (prevSchemas.includes(innerSchema)) { + return "(recursive)"; + } + + return this.formatSchema(innerSchema, newLogic, prevSchemas.concat(schema)); + }; + + if (hasNotInSchema(schema) && !likeObject(schema)) { + if (canApplyNot(schema.not)) { + newLogic = !logic; + return formatInnerSchema(schema.not); + } + + const needApplyLogicHere = !schema.not.not; + const prefix = logic ? "" : "non "; + newLogic = !logic; + return needApplyLogicHere ? prefix + formatInnerSchema(schema.not) : formatInnerSchema(schema.not); + } + + if ( + /** @type {Schema & {instanceof: string | Array}} */ + schema.instanceof) { + const { + instanceof: value + } = + /** @type {Schema & {instanceof: string | Array}} */ + schema; + const values = !Array.isArray(value) ? [value] : value; + return values.map( + /** + * @param {string} item + * @returns {string} + */ + item => item === "Function" ? "function" : item).join(" | "); + } + + if (schema.enum) { + return ( + /** @type {Array} */ + schema.enum.map(item => JSON.stringify(item)).join(" | ") + ); + } + + if (typeof schema.const !== "undefined") { + return JSON.stringify(schema.const); + } + + if (schema.oneOf) { + return ( + /** @type {Array} */ + schema.oneOf.map(item => formatInnerSchema(item, true)).join(" | ") + ); + } + + if (schema.anyOf) { + return ( + /** @type {Array} */ + schema.anyOf.map(item => formatInnerSchema(item, true)).join(" | ") + ); + } + + if (schema.allOf) { + return ( + /** @type {Array} */ + schema.allOf.map(item => formatInnerSchema(item, true)).join(" & ") + ); + } + + if ( + /** @type {JSONSchema7} */ + schema.if) { + const { + if: ifValue, + then: thenValue, + else: elseValue + } = + /** @type {JSONSchema7} */ + schema; + return `${ifValue ? `if ${formatInnerSchema(ifValue)}` : ""}${thenValue ? ` then ${formatInnerSchema(thenValue)}` : ""}${elseValue ? ` else ${formatInnerSchema(elseValue)}` : ""}`; + } + + if (schema.$ref) { + return formatInnerSchema(this.getSchemaPart(schema.$ref), true); + } + + if (likeNumber(schema) || likeInteger(schema)) { + const [type, ...hints] = getHints(schema, logic); + const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : ""}`; + return logic ? str : hints.length > 0 ? `non-${type} | ${str}` : `non-${type}`; + } + + if (likeString(schema)) { + const [type, ...hints] = getHints(schema, logic); + const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : ""}`; + return logic ? str : str === "string" ? "non-string" : `non-string | ${str}`; + } + + if (likeBoolean(schema)) { + return `${logic ? "" : "non-"}boolean`; + } + + if (likeArray(schema)) { + // not logic already applied in formatValidationError + newLogic = true; + const hints = []; + + if (typeof schema.minItems === "number") { + hints.push(`should not have fewer than ${schema.minItems} item${schema.minItems > 1 ? "s" : ""}`); + } + + if (typeof schema.maxItems === "number") { + hints.push(`should not have more than ${schema.maxItems} item${schema.maxItems > 1 ? "s" : ""}`); + } + + if (schema.uniqueItems) { + hints.push("should not have duplicate items"); + } + + const hasAdditionalItems = typeof schema.additionalItems === "undefined" || Boolean(schema.additionalItems); + let items = ""; + + if (schema.items) { + if (Array.isArray(schema.items) && schema.items.length > 0) { + items = `${ + /** @type {Array} */ + schema.items.map(item => formatInnerSchema(item)).join(", ")}`; + + if (hasAdditionalItems) { + if (schema.additionalItems && isObject(schema.additionalItems) && Object.keys(schema.additionalItems).length > 0) { + hints.push(`additional items should be ${formatInnerSchema(schema.additionalItems)}`); + } + } + } else if (schema.items && Object.keys(schema.items).length > 0) { + // "additionalItems" is ignored + items = `${formatInnerSchema(schema.items)}`; + } else { + // Fallback for empty `items` value + items = "any"; + } + } else { + // "additionalItems" is ignored + items = "any"; + } + + if (schema.contains && Object.keys(schema.contains).length > 0) { + hints.push(`should contains at least one ${this.formatSchema(schema.contains)} item`); + } + + return `[${items}${hasAdditionalItems ? ", ..." : ""}]${hints.length > 0 ? ` (${hints.join(", ")})` : ""}`; + } + + if (likeObject(schema)) { + // not logic already applied in formatValidationError + newLogic = true; + const hints = []; + + if (typeof schema.minProperties === "number") { + hints.push(`should not have fewer than ${schema.minProperties} ${schema.minProperties > 1 ? "properties" : "property"}`); + } + + if (typeof schema.maxProperties === "number") { + hints.push(`should not have more than ${schema.maxProperties} ${schema.minProperties && schema.minProperties > 1 ? "properties" : "property"}`); + } + + if (schema.patternProperties && Object.keys(schema.patternProperties).length > 0) { + const patternProperties = Object.keys(schema.patternProperties); + hints.push(`additional property names should match pattern${patternProperties.length > 1 ? "s" : ""} ${patternProperties.map(pattern => JSON.stringify(pattern)).join(" | ")}`); + } + + const properties = schema.properties ? Object.keys(schema.properties) : []; + const required = schema.required ? schema.required : []; + const allProperties = [...new Set( + /** @type {Array} */ + [].concat(required).concat(properties))]; + const objectStructure = allProperties.map(property => { + const isRequired = required.includes(property); // Some properties need quotes, maybe we should add check + // Maybe we should output type of property (`foo: string`), but it is looks very unreadable + + return `${property}${isRequired ? "" : "?"}`; + }).concat(typeof schema.additionalProperties === "undefined" || Boolean(schema.additionalProperties) ? schema.additionalProperties && isObject(schema.additionalProperties) ? [`: ${formatInnerSchema(schema.additionalProperties)}`] : ["…"] : []).join(", "); + const { + dependencies, + propertyNames, + patternRequired + } = + /** @type {Schema & {patternRequired?: Array;}} */ + schema; + + if (dependencies) { + Object.keys(dependencies).forEach(dependencyName => { + const dependency = dependencies[dependencyName]; + + if (Array.isArray(dependency)) { + hints.push(`should have ${dependency.length > 1 ? "properties" : "property"} ${dependency.map(dep => `'${dep}'`).join(", ")} when property '${dependencyName}' is present`); + } else { + hints.push(`should be valid according to the schema ${formatInnerSchema(dependency)} when property '${dependencyName}' is present`); + } + }); + } + + if (propertyNames && Object.keys(propertyNames).length > 0) { + hints.push(`each property name should match format ${JSON.stringify(schema.propertyNames.format)}`); + } + + if (patternRequired && patternRequired.length > 0) { + hints.push(`should have property matching pattern ${patternRequired.map( + /** + * @param {string} item + * @returns {string} + */ + item => JSON.stringify(item))}`); + } + + return `object {${objectStructure ? ` ${objectStructure} ` : ""}}${hints.length > 0 ? ` (${hints.join(", ")})` : ""}`; + } + + if (likeNull(schema)) { + return `${logic ? "" : "non-"}null`; + } + + if (Array.isArray(schema.type)) { + // not logic already applied in formatValidationError + return `${schema.type.join(" | ")}`; + } // Fallback for unknown keywords + // not logic already applied in formatValidationError + + /* istanbul ignore next */ + + + return JSON.stringify(schema, null, 2); + } + /** + * @param {Schema=} schemaPart + * @param {(boolean | Array)=} additionalPath + * @param {boolean=} needDot + * @param {boolean=} logic + * @returns {string} + */ + + + getSchemaPartText(schemaPart, additionalPath, needDot = false, logic = true) { + if (!schemaPart) { + return ""; + } + + if (Array.isArray(additionalPath)) { + for (let i = 0; i < additionalPath.length; i++) { + /** @type {Schema | undefined} */ + const inner = schemaPart[ + /** @type {keyof Schema} */ + additionalPath[i]]; + + if (inner) { + // eslint-disable-next-line no-param-reassign + schemaPart = inner; + } else { + break; + } + } + } + + while (schemaPart.$ref) { + // eslint-disable-next-line no-param-reassign + schemaPart = this.getSchemaPart(schemaPart.$ref); + } + + let schemaText = `${this.formatSchema(schemaPart, logic)}${needDot ? "." : ""}`; + + if (schemaPart.description) { + schemaText += `\n-> ${schemaPart.description}`; + } + + if (schemaPart.link) { + schemaText += `\n-> Read more at ${schemaPart.link}`; + } + + return schemaText; + } + /** + * @param {Schema=} schemaPart + * @returns {string} + */ + + + getSchemaPartDescription(schemaPart) { + if (!schemaPart) { + return ""; + } + + while (schemaPart.$ref) { + // eslint-disable-next-line no-param-reassign + schemaPart = this.getSchemaPart(schemaPart.$ref); + } + + let schemaText = ""; + + if (schemaPart.description) { + schemaText += `\n-> ${schemaPart.description}`; + } + + if (schemaPart.link) { + schemaText += `\n-> Read more at ${schemaPart.link}`; + } + + return schemaText; + } + /** + * @param {SchemaUtilErrorObject} error + * @returns {string} + */ + + + formatValidationError(error) { + const { + keyword, + dataPath: errorDataPath + } = error; + const dataPath = `${this.baseDataPath}${errorDataPath}`; + + switch (keyword) { + case "type": + { + const { + parentSchema, + params + } = error; // eslint-disable-next-line default-case + + switch ( + /** @type {import("ajv").TypeParams} */ + params.type) { + case "number": + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + case "integer": + return `${dataPath} should be an ${this.getSchemaPartText(parentSchema, false, true)}`; + + case "string": + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + case "boolean": + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + case "array": + return `${dataPath} should be an array:\n${this.getSchemaPartText(parentSchema)}`; + + case "object": + return `${dataPath} should be an object:\n${this.getSchemaPartText(parentSchema)}`; + + case "null": + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + default: + return `${dataPath} should be:\n${this.getSchemaPartText(parentSchema)}`; + } + } + + case "instanceof": + { + const { + parentSchema + } = error; + return `${dataPath} should be an instance of ${this.getSchemaPartText(parentSchema, false, true)}`; + } + + case "pattern": + { + const { + params, + parentSchema + } = error; + const { + pattern + } = + /** @type {import("ajv").PatternParams} */ + params; + return `${dataPath} should match pattern ${JSON.stringify(pattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "format": + { + const { + params, + parentSchema + } = error; + const { + format + } = + /** @type {import("ajv").FormatParams} */ + params; + return `${dataPath} should match format ${JSON.stringify(format)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "formatMinimum": + case "formatMaximum": + { + const { + params, + parentSchema + } = error; + const { + comparison, + limit + } = + /** @type {import("ajv").ComparisonParams} */ + params; + return `${dataPath} should be ${comparison} ${JSON.stringify(limit)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "minimum": + case "maximum": + case "exclusiveMinimum": + case "exclusiveMaximum": + { + const { + parentSchema, + params + } = error; + const { + comparison, + limit + } = + /** @type {import("ajv").ComparisonParams} */ + params; + const [, ...hints] = getHints( + /** @type {Schema} */ + parentSchema, true); + + if (hints.length === 0) { + hints.push(`should be ${comparison} ${limit}`); + } + + return `${dataPath} ${hints.join(" ")}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "multipleOf": + { + const { + params, + parentSchema + } = error; + const { + multipleOf + } = + /** @type {import("ajv").MultipleOfParams} */ + params; + return `${dataPath} should be multiple of ${multipleOf}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "patternRequired": + { + const { + params, + parentSchema + } = error; + const { + missingPattern + } = + /** @type {import("ajv").PatternRequiredParams} */ + params; + return `${dataPath} should have property matching pattern ${JSON.stringify(missingPattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "minLength": + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + + if (limit === 1) { + return `${dataPath} should be a non-empty string${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + const length = limit - 1; + return `${dataPath} should be longer than ${length} character${length > 1 ? "s" : ""}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "minItems": + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + + if (limit === 1) { + return `${dataPath} should be a non-empty array${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + return `${dataPath} should not have fewer than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "minProperties": + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + + if (limit === 1) { + return `${dataPath} should be a non-empty object${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + return `${dataPath} should not have fewer than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "maxLength": + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + const max = limit + 1; + return `${dataPath} should be shorter than ${max} character${max > 1 ? "s" : ""}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "maxItems": + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "maxProperties": + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + return `${dataPath} should not have more than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "uniqueItems": + { + const { + params, + parentSchema + } = error; + const { + i + } = + /** @type {import("ajv").UniqueItemsParams} */ + params; + return `${dataPath} should not contain the item '${error.data[i]}' twice${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "additionalItems": + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}. These items are valid:\n${this.getSchemaPartText(parentSchema)}`; + } + + case "contains": + { + const { + parentSchema + } = error; + return `${dataPath} should contains at least one ${this.getSchemaPartText(parentSchema, ["contains"])} item${getSchemaNonTypes(parentSchema)}.`; + } + + case "required": + { + const { + parentSchema, + params + } = error; + const missingProperty = + /** @type {import("ajv").DependenciesParams} */ + params.missingProperty.replace(/^\./, ""); + const hasProperty = parentSchema && Boolean( + /** @type {Schema} */ + parentSchema.properties && + /** @type {Schema} */ + parentSchema.properties[missingProperty]); + return `${dataPath} misses the property '${missingProperty}'${getSchemaNonTypes(parentSchema)}.${hasProperty ? ` Should be:\n${this.getSchemaPartText(parentSchema, ["properties", missingProperty])}` : this.getSchemaPartDescription(parentSchema)}`; + } + + case "additionalProperties": + { + const { + params, + parentSchema + } = error; + const { + additionalProperty + } = + /** @type {import("ajv").AdditionalPropertiesParams} */ + params; + return `${dataPath} has an unknown property '${additionalProperty}'${getSchemaNonTypes(parentSchema)}. These properties are valid:\n${this.getSchemaPartText(parentSchema)}`; + } + + case "dependencies": + { + const { + params, + parentSchema + } = error; + const { + property, + deps + } = + /** @type {import("ajv").DependenciesParams} */ + params; + const dependencies = deps.split(",").map( + /** + * @param {string} dep + * @returns {string} + */ + dep => `'${dep.trim()}'`).join(", "); + return `${dataPath} should have properties ${dependencies} when property '${property}' is present${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "propertyNames": + { + const { + params, + parentSchema, + schema + } = error; + const { + propertyName + } = + /** @type {import("ajv").PropertyNamesParams} */ + params; + return `${dataPath} property name '${propertyName}' is invalid${getSchemaNonTypes(parentSchema)}. Property names should be match format ${JSON.stringify(schema.format)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case "enum": + { + const { + parentSchema + } = error; + + if (parentSchema && + /** @type {Schema} */ + parentSchema.enum && + /** @type {Schema} */ + parentSchema.enum.length === 1) { + return `${dataPath} should be ${this.getSchemaPartText(parentSchema, false, true)}`; + } + + return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}`; + } + + case "const": + { + const { + parentSchema + } = error; + return `${dataPath} should be equal to constant ${this.getSchemaPartText(parentSchema, false, true)}`; + } + + case "not": + { + const postfix = likeObject( + /** @type {Schema} */ + error.parentSchema) ? `\n${this.getSchemaPartText(error.parentSchema)}` : ""; + const schemaOutput = this.getSchemaPartText(error.schema, false, false, false); + + if (canApplyNot(error.schema)) { + return `${dataPath} should be any ${schemaOutput}${postfix}.`; + } + + const { + schema, + parentSchema + } = error; + return `${dataPath} should not be ${this.getSchemaPartText(schema, false, true)}${parentSchema && likeObject(parentSchema) ? `\n${this.getSchemaPartText(parentSchema)}` : ""}`; + } + + case "oneOf": + case "anyOf": + { + const { + parentSchema, + children + } = error; + + if (children && children.length > 0) { + if (error.schema.length === 1) { + const lastChild = children[children.length - 1]; + const remainingChildren = children.slice(0, children.length - 1); + return this.formatValidationError(Object.assign({}, lastChild, { + children: remainingChildren, + parentSchema: Object.assign({}, parentSchema, lastChild.parentSchema) + })); + } + + let filteredChildren = filterChildren(children); + + if (filteredChildren.length === 1) { + return this.formatValidationError(filteredChildren[0]); + } + + filteredChildren = groupChildrenByFirstChild(filteredChildren); + return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}\nDetails:\n${filteredChildren.map( + /** + * @param {SchemaUtilErrorObject} nestedError + * @returns {string} + */ + nestedError => ` * ${indent(this.formatValidationError(nestedError), " ")}`).join("\n")}`; + } + + return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}`; + } + + case "if": + { + const { + params, + parentSchema + } = error; + const { + failingKeyword + } = + /** @type {import("ajv").IfParams} */ + params; + return `${dataPath} should match "${failingKeyword}" schema:\n${this.getSchemaPartText(parentSchema, [failingKeyword])}`; + } + + case "absolutePath": + { + const { + message, + parentSchema + } = error; + return `${dataPath}: ${message}${this.getSchemaPartDescription(parentSchema)}`; + } + + /* istanbul ignore next */ + + default: + { + const { + message, + parentSchema + } = error; + const ErrorInJSON = JSON.stringify(error, null, 2); // For `custom`, `false schema`, `$ref` keywords + // Fallback for unknown keywords + + return `${dataPath} ${message} (${ErrorInJSON}).\n${this.getSchemaPartText(parentSchema, false)}`; + } + } + } + /** + * @param {Array} errors + * @returns {string} + */ + + + formatValidationErrors(errors) { + return errors.map(error => { + let formattedError = this.formatValidationError(error); + + if (this.postFormatter) { + formattedError = this.postFormatter(formattedError, error); + } + + return ` - ${indent(formattedError, " ")}`; + }).join("\n"); + } + +} + +var _default = ValidationError; +exports.Z = _default; + +/***/ }), + +/***/ 81184: +/***/ (function(module) { + +"use strict"; + + +/** + * @typedef {[number, boolean]} RangeValue + */ + +/** + * @callback RangeValueCallback + * @param {RangeValue} rangeValue + * @returns {boolean} + */ +class Range { + /** + * @param {"left" | "right"} side + * @param {boolean} exclusive + * @returns {">" | ">=" | "<" | "<="} + */ + static getOperator(side, exclusive) { + if (side === "left") { + return exclusive ? ">" : ">="; + } + + return exclusive ? "<" : "<="; + } + /** + * @param {number} value + * @param {boolean} logic is not logic applied + * @param {boolean} exclusive is range exclusive + * @returns {string} + */ + + + static formatRight(value, logic, exclusive) { + if (logic === false) { + return Range.formatLeft(value, !logic, !exclusive); + } + + return `should be ${Range.getOperator("right", exclusive)} ${value}`; + } + /** + * @param {number} value + * @param {boolean} logic is not logic applied + * @param {boolean} exclusive is range exclusive + * @returns {string} + */ + + + static formatLeft(value, logic, exclusive) { + if (logic === false) { + return Range.formatRight(value, !logic, !exclusive); + } + + return `should be ${Range.getOperator("left", exclusive)} ${value}`; + } + /** + * @param {number} start left side value + * @param {number} end right side value + * @param {boolean} startExclusive is range exclusive from left side + * @param {boolean} endExclusive is range exclusive from right side + * @param {boolean} logic is not logic applied + * @returns {string} + */ + + + static formatRange(start, end, startExclusive, endExclusive, logic) { + let result = "should be"; + result += ` ${Range.getOperator(logic ? "left" : "right", logic ? startExclusive : !startExclusive)} ${start} `; + result += logic ? "and" : "or"; + result += ` ${Range.getOperator(logic ? "right" : "left", logic ? endExclusive : !endExclusive)} ${end}`; + return result; + } + /** + * @param {Array} values + * @param {boolean} logic is not logic applied + * @return {RangeValue} computed value and it's exclusive flag + */ + + + static getRangeValue(values, logic) { + let minMax = logic ? Infinity : -Infinity; + let j = -1; + const predicate = logic ? + /** @type {RangeValueCallback} */ + ([value]) => value <= minMax : + /** @type {RangeValueCallback} */ + ([value]) => value >= minMax; + + for (let i = 0; i < values.length; i++) { + if (predicate(values[i])) { + [minMax] = values[i]; + j = i; + } + } + + if (j > -1) { + return values[j]; + } + + return [Infinity, true]; + } + + constructor() { + /** @type {Array} */ + this._left = []; + /** @type {Array} */ + + this._right = []; + } + /** + * @param {number} value + * @param {boolean=} exclusive + */ + + + left(value, exclusive = false) { + this._left.push([value, exclusive]); + } + /** + * @param {number} value + * @param {boolean=} exclusive + */ + + + right(value, exclusive = false) { + this._right.push([value, exclusive]); + } + /** + * @param {boolean} logic is not logic applied + * @return {string} "smart" range string representation + */ + + + format(logic = true) { + const [start, leftExclusive] = Range.getRangeValue(this._left, logic); + const [end, rightExclusive] = Range.getRangeValue(this._right, !logic); + + if (!Number.isFinite(start) && !Number.isFinite(end)) { + return ""; + } + + const realStart = leftExclusive ? start + 1 : start; + const realEnd = rightExclusive ? end - 1 : end; // e.g. 5 < x < 7, 5 < x <= 6, 6 <= x <= 6 + + if (realStart === realEnd) { + return `should be ${logic ? "" : "!"}= ${realStart}`; + } // e.g. 4 < x < ∞ + + + if (Number.isFinite(start) && !Number.isFinite(end)) { + return Range.formatLeft(start, logic, leftExclusive); + } // e.g. ∞ < x < 4 + + + if (!Number.isFinite(start) && Number.isFinite(end)) { + return Range.formatRight(end, logic, rightExclusive); + } + + return Range.formatRange(start, end, leftExclusive, rightExclusive, logic); + } + +} + +module.exports = Range; + +/***/ }), + +/***/ 79926: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; + + +const Range = __webpack_require__(81184); +/** @typedef {import("../validate").Schema} Schema */ + +/** + * @param {Schema} schema + * @param {boolean} logic + * @return {string[]} + */ + + +module.exports.stringHints = function stringHints(schema, logic) { + const hints = []; + let type = "string"; + const currentSchema = { ...schema + }; + + if (!logic) { + const tmpLength = currentSchema.minLength; + const tmpFormat = currentSchema.formatMinimum; + const tmpExclusive = currentSchema.formatExclusiveMaximum; + currentSchema.minLength = currentSchema.maxLength; + currentSchema.maxLength = tmpLength; + currentSchema.formatMinimum = currentSchema.formatMaximum; + currentSchema.formatMaximum = tmpFormat; + currentSchema.formatExclusiveMaximum = !currentSchema.formatExclusiveMinimum; + currentSchema.formatExclusiveMinimum = !tmpExclusive; + } + + if (typeof currentSchema.minLength === "number") { + if (currentSchema.minLength === 1) { + type = "non-empty string"; + } else { + const length = Math.max(currentSchema.minLength - 1, 0); + hints.push(`should be longer than ${length} character${length > 1 ? "s" : ""}`); + } + } + + if (typeof currentSchema.maxLength === "number") { + if (currentSchema.maxLength === 0) { + type = "empty string"; + } else { + const length = currentSchema.maxLength + 1; + hints.push(`should be shorter than ${length} character${length > 1 ? "s" : ""}`); + } + } + + if (currentSchema.pattern) { + hints.push(`should${logic ? "" : " not"} match pattern ${JSON.stringify(currentSchema.pattern)}`); + } + + if (currentSchema.format) { + hints.push(`should${logic ? "" : " not"} match format ${JSON.stringify(currentSchema.format)}`); + } + + if (currentSchema.formatMinimum) { + hints.push(`should be ${currentSchema.formatExclusiveMinimum ? ">" : ">="} ${JSON.stringify(currentSchema.formatMinimum)}`); + } + + if (currentSchema.formatMaximum) { + hints.push(`should be ${currentSchema.formatExclusiveMaximum ? "<" : "<="} ${JSON.stringify(currentSchema.formatMaximum)}`); + } + + return [type].concat(hints); +}; +/** + * @param {Schema} schema + * @param {boolean} logic + * @return {string[]} + */ + + +module.exports.numberHints = function numberHints(schema, logic) { + const hints = [schema.type === "integer" ? "integer" : "number"]; + const range = new Range(); + + if (typeof schema.minimum === "number") { + range.left(schema.minimum); + } + + if (typeof schema.exclusiveMinimum === "number") { + range.left(schema.exclusiveMinimum, true); + } + + if (typeof schema.maximum === "number") { + range.right(schema.maximum); + } + + if (typeof schema.exclusiveMaximum === "number") { + range.right(schema.exclusiveMaximum, true); + } + + const rangeFormat = range.format(logic); + + if (rangeFormat) { + hints.push(rangeFormat); + } + + if (typeof schema.multipleOf === "number") { + hints.push(`should${logic ? "" : " not"} be multiple of ${schema.multipleOf}`); + } + + return hints; +}; + /***/ }), /***/ 74315: diff --git a/packages/next/package.json b/packages/next/package.json index e7442ee8955a374..25b03d27f49c9ec 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -71,8 +71,8 @@ ] }, "dependencies": { - "@next/env": "12.0.8-canary.17", - "@next/react-refresh-utils": "12.0.8-canary.17", + "@next/env": "12.0.8-canary.20", + "@next/react-refresh-utils": "12.0.8-canary.20", "caniuse-lite": "^1.0.30001283", "jest-worker": "27.0.0-next.5", "node-fetch": "2.6.1", @@ -125,10 +125,10 @@ "@hapi/accept": "5.0.2", "@napi-rs/cli": "1.2.1", "@napi-rs/triples": "1.0.3", - "@next/polyfill-module": "12.0.8-canary.17", - "@next/polyfill-nomodule": "12.0.8-canary.17", - "@next/react-dev-overlay": "12.0.8-canary.17", - "@next/swc": "12.0.8-canary.17", + "@next/polyfill-module": "12.0.8-canary.20", + "@next/polyfill-nomodule": "12.0.8-canary.20", + "@next/react-dev-overlay": "12.0.8-canary.20", + "@next/swc": "12.0.8-canary.20", "@peculiar/webcrypto": "1.1.7", "@taskr/clear": "1.1.0", "@taskr/esnext": "1.1.0", @@ -166,7 +166,7 @@ "@types/webpack-sources1": "npm:@types/webpack-sources@0.1.5", "@types/ws": "8.2.0", "@vercel/ncc": "0.33.1", - "@vercel/nft": "0.17.1", + "@vercel/nft": "0.17.2", "acorn": "8.5.0", "amphtml-validator": "1.0.33", "arg": "4.1.0", diff --git a/packages/next/server/response-cache.ts b/packages/next/server/response-cache.ts index da10c8c3bd3457d..2279733e721e406 100644 --- a/packages/next/server/response-cache.ts +++ b/packages/next/server/response-cache.ts @@ -107,7 +107,13 @@ export default class ResponseCache { ) } } catch (err) { - rejecter(err as Error) + // while revalidating in the background we can't reject as + // we already resolved the cache entry so log the error here + if (resolved) { + console.error(err) + } else { + rejecter(err as Error) + } } finally { if (key) { this.pendingResponses.delete(key) diff --git a/packages/next/shared/lib/constants.ts b/packages/next/shared/lib/constants.ts index 2940fc4c49ee10d..790eaedca07c122 100644 --- a/packages/next/shared/lib/constants.ts +++ b/packages/next/shared/lib/constants.ts @@ -46,6 +46,7 @@ export const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = `webpack` export const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL = Symbol(`polyfills`) // server/middleware-flight-runtime.js export const MIDDLEWARE_SSR_RUNTIME_WEBPACK = 'middleware-ssr-runtime' +export const MIDDLEWARE_RUNTIME_WEBPACK = 'middleware-runtime' export const TEMPORARY_REDIRECT_STATUS = 307 export const PERMANENT_REDIRECT_STATUS = 308 export const STATIC_PROPS_ID = '__N_SSG' diff --git a/packages/react-dev-overlay/package.json b/packages/react-dev-overlay/package.json index a22e41895c55c0d..fd8942d74e00f0e 100644 --- a/packages/react-dev-overlay/package.json +++ b/packages/react-dev-overlay/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-dev-overlay", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "description": "A development-only overlay for developing React applications.", "repository": { "url": "vercel/next.js", diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index 447adca6df43df0..1254bdedf99e297 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "12.0.8-canary.17", + "version": "12.0.8-canary.20", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/plopfile.js b/plopfile.js new file mode 100644 index 000000000000000..2dc8b7e619e01cd --- /dev/null +++ b/plopfile.js @@ -0,0 +1,71 @@ +module.exports = function (plop) { + function getFileName(str) { + return str.toLowerCase().replace(/ /g, '-') + } + + plop.setGenerator('test', { + description: 'Create a new test', + prompts: [ + { + type: 'input', + name: 'name', + message: 'Test name', + }, + { + type: 'list', + name: 'type', + message: 'Test type', + choices: ['e2e', 'unit', 'production', 'development'], + }, + ], + actions: function (data) { + const fileName = getFileName(data.name) + return [ + { + type: 'add', + templateFile: `test/${ + data.type === 'unit' ? 'unit' : 'e2e' + }/example.txt`, + path: `test/{{type}}/${ + data.type === 'unit' + ? `${fileName}.test.ts` + : `${fileName}/index.test.ts` + }`, + }, + ] + }, + }) + + plop.setGenerator('error', { + description: 'Create a new error document', + prompts: [ + { + name: 'title', + type: 'input', + message: 'Title for the error', + }, + ], + actions: function (data) { + const fileName = getFileName(data.title) + return [ + { + type: 'add', + path: `errors/${fileName}.md`, + templateFile: `errors/template.txt`, + }, + { + type: 'modify', + path: 'errors/manifest.json', + transform(fileContents, data) { + const manifestData = JSON.parse(fileContents) + manifestData.routes[0].routes.push({ + title: fileName, + path: `/errors/${fileName}.md`, + }) + return JSON.stringify(manifestData, null, 2) + }, + }, + ] + }, + }) +} diff --git a/test/e2e/example.test.txt b/test/e2e/example.txt similarity index 68% rename from test/e2e/example.test.txt rename to test/e2e/example.txt index f4246bab6d273bb..a9a92aeaa9b76bd 100644 --- a/test/e2e/example.test.txt +++ b/test/e2e/example.txt @@ -1,7 +1,8 @@ import { createNext } from 'e2e-utils' import { NextInstance } from 'test/lib/next-modes/base' +import { renderViaHTTP } from 'next-test-utils' -describe('should set-up next', () => { +describe('{{name}}', () => { let next: NextInstance beforeAll(async () => { @@ -13,11 +14,13 @@ describe('should set-up next', () => { } ` }, + dependencies: {} }) }) afterAll(() => next.destroy()) it('should work', async () => { - console.log(next.url, next.appPort) + const html = await renderViaHTTP(next.url, '/') + expect(html).toContain('hello world') }) }) diff --git a/test/integration/data-fetching-errors/test/index.test.js b/test/integration/data-fetching-errors/test/index.test.js index a04a6ac91857c15..611bdb75310b0ae 100644 --- a/test/integration/data-fetching-errors/test/index.test.js +++ b/test/integration/data-fetching-errors/test/index.test.js @@ -7,12 +7,15 @@ import { launchApp, nextBuild, renderViaHTTP, + nextStart, + check, } from 'next-test-utils' import { join } from 'path' import { GSP_NO_RETURNED_VALUE, GSSP_NO_RETURNED_VALUE, } from '../../../../packages/next/dist/lib/constants' +import { PHASE_PRODUCTION_BUILD } from '../../../../packages/next/shared/lib/constants' const appDir = join(__dirname, '..') const indexPage = join(appDir, 'pages/index.js') @@ -130,7 +133,49 @@ describe('GS(S)P Page Errors', () => { runTests(true) }) - describe('production mode', () => { + describe('build mode', () => { runTests() }) + + describe('start mode', () => { + it('Error stack printed to stderr', async () => { + try { + await fs.writeFile( + indexPage, + `export default function Page() { + return
+ } + export function getStaticProps() { + // Make it pass on the build phase + if(process.env.NEXT_PHASE === "${PHASE_PRODUCTION_BUILD}") { + return { props: { foo: 'bar' }, revalidate: 1 } + } + + throw new Error("Oops") + } + ` + ) + + await nextBuild(appDir) + + appPort = await findPort() + + let stderr = '' + app = await nextStart(appDir, appPort, { + onStderr: (msg) => { + stderr += msg || '' + }, + }) + await check(async () => { + await renderViaHTTP(appPort, '/') + return stderr + }, /error: oops/i) + + expect(stderr).toContain('Error: Oops') + expect(stderr).toContain(`\n at getStaticProps`) + } finally { + await killApp(app) + } + }) + }) }) diff --git a/test/integration/middleware/core/test/index.test.js b/test/integration/middleware/core/test/index.test.js index 43c24df8df3f2cf..25f4e01634ab365 100644 --- a/test/integration/middleware/core/test/index.test.js +++ b/test/integration/middleware/core/test/index.test.js @@ -93,16 +93,12 @@ describe('Middleware base tests', () => { ) for (const key of Object.keys(manifest.middleware)) { const middleware = manifest.middleware[key] - expect( - middleware.files.some((file) => file.includes('webpack-middleware')) - ).toBe(true) - expect( - middleware.files.filter( - (file) => - file.startsWith('static/chunks/') && - !file.startsWith('static/chunks/webpack-middleware') - ).length - ).toBe(0) + expect(middleware.files).toContainEqual( + expect.stringContaining('middleware-runtime') + ) + expect(middleware.files).not.toContainEqual( + expect.stringContaining('static/chunks/') + ) } }) }) diff --git a/test/production/dependencies-can-use-env-vars-in-middlewares/index.test.ts b/test/production/dependencies-can-use-env-vars-in-middlewares/index.test.ts new file mode 100644 index 000000000000000..356aa4174b34548 --- /dev/null +++ b/test/production/dependencies-can-use-env-vars-in-middlewares/index.test.ts @@ -0,0 +1,73 @@ +import { createNext } from 'e2e-utils' +import { NextInstance } from 'test/lib/next-modes/base' +import { renderViaHTTP } from 'next-test-utils' +import { readJson } from 'fs-extra' +import path from 'path' + +describe('dependencies can use env vars in middlewares', () => { + let next: NextInstance + + beforeAll(() => { + process.env.MY_CUSTOM_PACKAGE_ENV_VAR = 'my-custom-package-env-var' + process.env.ENV_VAR_USED_IN_MIDDLEWARE = 'env-var-used-in-middleware' + }) + + beforeAll(async () => { + next = await createNext({ + files: { + // A 3rd party dependency + 'node_modules/my-custom-package/package.json': JSON.stringify({ + name: 'my-custom-package', + version: '1.0.0', + browser: 'index.js', + }), + 'node_modules/my-custom-package/index.js': ` + module.exports = () => process.env.MY_CUSTOM_PACKAGE_ENV_VAR; + `, + + // The actual middleware code + 'pages/api/_middleware.js': ` + import customPackage from 'my-custom-package'; + export default function middleware(_req) { + return new Response(JSON.stringify({ + string: "a constant string", + hello: process.env.ENV_VAR_USED_IN_MIDDLEWARE, + customPackage: customPackage(), + }), { + headers: { + 'Content-Type': 'application/json' + } + }) + } + `, + }, + dependencies: {}, + }) + }) + afterAll(() => next.destroy()) + + it('parses the env vars correctly', async () => { + const testDir = next.testDir + const manifestPath = path.join( + testDir, + '.next/server/middleware-manifest.json' + ) + const manifest = await readJson(manifestPath) + const envVars = manifest?.middleware?.['/api']?.env + + expect(envVars).toHaveLength(2) + expect(envVars).toContain('ENV_VAR_USED_IN_MIDDLEWARE') + expect(envVars).toContain('MY_CUSTOM_PACKAGE_ENV_VAR') + }) + + it('uses the environment variables', async () => { + const html = await renderViaHTTP(next.url, '/api') + expect(html).toContain( + JSON.stringify({ + string: 'a constant string', + hello: 'env-var-used-in-middleware', + customPackage: 'my-custom-package-env-var', + }) + ) + }) +}) diff --git a/test/production/required-server-files.test.ts b/test/production/required-server-files.test.ts index 61794732f0410cd..d3a1def51429468 100644 --- a/test/production/required-server-files.test.ts +++ b/test/production/required-server-files.test.ts @@ -108,10 +108,10 @@ describe('should set-up next', () => { }) it('should output middleware correctly', async () => { - // the middleware-runtime is located in .next/static/chunks so ensure - // the folder is present expect( - await fs.pathExists(join(next.testDir, 'standalone/.next/static/chunks')) + await fs.pathExists( + join(next.testDir, 'standalone/.next/server/middleware-runtime.js') + ) ).toBe(true) expect( await fs.pathExists( @@ -121,6 +121,11 @@ describe('should set-up next', () => { ) ) ).toBe(true) + expect( + await fs.pathExists( + join(next.testDir, 'standalone/.next/server/pages/_middleware.js') + ) + ).toBe(true) }) it('should output required-server-files manifest correctly', async () => { diff --git a/test/production/required-server-files/pages/_middleware.js b/test/production/required-server-files/pages/_middleware.js new file mode 100644 index 000000000000000..2f109e1d0dc84eb --- /dev/null +++ b/test/production/required-server-files/pages/_middleware.js @@ -0,0 +1,5 @@ +import { NextResponse } from 'next/server' + +export async function middleware(req) { + return NextResponse.next() +} diff --git a/test/readme.md b/test/readme.md index dfccd3fa1b3bd4f..186cd8bcf5ad45a 100644 --- a/test/readme.md +++ b/test/readme.md @@ -1,6 +1,10 @@ # Writing tests for Next.js -## Test types in Next.js +## Getting Started + +You can set-up a new test using `yarn new-test` which will start from a template related to the test type. + +## Test Types in Next.js - e2e: These tests will run against `next dev` and `next start` - development: These tests only run against `next dev` @@ -12,7 +16,9 @@ For the e2e, production, and development tests the `createNext` utility should b All new test suites should be written in TypeScript either `.ts` (or `.tsx` for unit tests). This will help ensure we catch smaller issues in tests that could cause flakey or incorrect tests. -## Best practices +If a test suite already exists that relates closely to the item being tested (e.g. hash navigation relates to existing navigation test suites) the new checks can be added in the existing test suite. + +## Best Practices - When checking for a condition that might take time, ensure it is waited for either using the browser `waitForElement` or using the `check` util in `next-test-utils`. - When applying a fix, ensure the test fails without the fix. This makes sure the test will properly catch regressions. diff --git a/test/unit/example.txt b/test/unit/example.txt new file mode 100644 index 000000000000000..0befa97c23a557e --- /dev/null +++ b/test/unit/example.txt @@ -0,0 +1,5 @@ +describe('{{name}}', () => { + it('should work', async () => { + expect(typeof 'hello').toBe('string') + }) +}) diff --git a/yarn.lock b/yarn.lock index e81e09737262240..e11c7c225f34bdb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4509,6 +4509,11 @@ "@types/express-serve-static-core" "*" "@types/serve-static" "*" +"@types/fined@*": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@types/fined/-/fined-1.1.3.tgz#83f03e8f0a8d3673dfcafb18fce3571f6250e1bc" + integrity sha512-CWYnSRnun3CGbt6taXeVo2lCbuaj4mchVJ4UF/BdU5TSuIn3AmS13pGMwCsBUoehGbhZrBrpNJZSZI5EVilXww== + "@types/fresh@0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@types/fresh/-/fresh-0.5.0.tgz#4d09231027d69c4369cfb01a9af5ef083d0d285f" @@ -4550,6 +4555,14 @@ dependencies: "@types/node" "*" +"@types/inquirer@^8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.1.3.tgz#dfda4c97cdbe304e4dceb378a80f79448ea5c8fe" + integrity sha512-AayK4ZL5ssPzR1OtnOLGAwpT0Dda3Xi/h1G0l1oJDNrowp7T1423q4Zb8/emr7tzRlCy4ssEri0LWVexAqHyKQ== + dependencies: + "@types/through" "*" + rxjs "^7.2.0" + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -4631,6 +4644,14 @@ dependencies: "@types/node" "*" +"@types/liftoff@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/liftoff/-/liftoff-4.0.0.tgz#d4a100d356529776ad47fee2a9ce8f1f1ffe3772" + integrity sha512-Ny/PJkO6nxWAQnaet8q/oWz15lrfwvdvBpuY4treB0CSsBO1CG0fVuNLngR3m3bepQLd+E4c3Y3DlC2okpUvPw== + dependencies: + "@types/fined" "*" + "@types/node" "*" + "@types/lodash.curry@4.1.6": version "4.1.6" resolved "https://registry.yarnpkg.com/@types/lodash.curry/-/lodash.curry-4.1.6.tgz#f26c490c80c92d7cbaa2300d542e89781d44b1ff" @@ -4861,6 +4882,13 @@ version "0.2.1" resolved "https://registry.yarnpkg.com/@types/text-table/-/text-table-0.2.1.tgz#39c4d4a058a82f677392dfd09976e83d9b4c9264" +"@types/through@*": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.30.tgz#e0e42ce77e897bd6aead6f6ea62aeb135b8a3895" + integrity sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg== + dependencies: + "@types/node" "*" + "@types/ua-parser-js@0.7.36": version "0.7.36" resolved "https://registry.yarnpkg.com/@types/ua-parser-js/-/ua-parser-js-0.7.36.tgz#9bd0b47f26b5a3151be21ba4ce9f5fa457c5f190" @@ -5126,17 +5154,17 @@ resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.33.1.tgz#b240080a3c1ded9446a30955a06a79851bb38f71" integrity sha512-Mlsps/P0PLZwsCFtSol23FGqT3FhBGb4B1AuGQ52JTAtXhak+b0Fh/4T55r0/SVQPeRiX9pNItOEHwakGPmZYA== -"@vercel/nft@0.17.1": - version "0.17.1" - resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.17.1.tgz#d1a22f9d25594b549d237d25d10595d62e60dd05" - integrity sha512-z3zknfI7JaE0PPmmYDQVtf/TCEnAYT5Y2XrCO/BfAD1sP2Wdmg1PO0L1VRIyt0zjpr6PpBYitC0Nmy0rh+qEDA== +"@vercel/nft@0.17.2": + version "0.17.2" + resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.17.2.tgz#88a8e088e0e91390c68ccce2180023c071bcdc77" + integrity sha512-1ueYh62H/DmUc3PWV/HEk1x6J1c/KZq9zeNXhixn/C4lX3XOsouutUVpKhTseoDKTGlT81hx96W4TjIwpDiIAQ== dependencies: "@mapbox/node-pre-gyp" "^1.0.5" acorn "^8.6.0" bindings "^1.4.0" estree-walker "2.0.2" glob "^7.1.3" - graceful-fs "^4.1.15" + graceful-fs "^4.2.9" micromatch "^4.0.2" mkdirp "^0.5.1" node-gyp-build "^4.2.2" @@ -5686,6 +5714,11 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -5802,6 +5835,11 @@ array-differ@^3.0.0: resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg== +array-each@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" + integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= + array-filter@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" @@ -5854,6 +5892,11 @@ array-iterate@^1.0.0: resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-1.1.4.tgz#add1522e9dd9749bb41152d08b845bd08d6af8b7" integrity sha512-sNRaPGh9nnmdC8Zf+pT3UqP8rnWj5Hf9wiFGsX3wUQ2yVSIhO2ShFwCoceIPpB41QF6i2OEmrHmCo36xronCVA== +array-slice@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" + integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== + array-union@^1.0.1, array-union@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -5865,6 +5908,11 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +array-union@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-3.0.1.tgz#da52630d327f8b88cfbfb57728e2af5cd9b6b975" + integrity sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw== + array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -6250,6 +6298,11 @@ base64-js@^1.0.2, base64-js@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -6301,6 +6354,24 @@ bindings@^1.4.0, bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" +bl@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + +bl@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-5.0.0.tgz#6928804a41e9da9034868e1c50ca88f21f57aea2" + integrity sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ== + dependencies: + buffer "^6.0.3" + inherits "^2.0.4" + readable-stream "^3.4.0" + bluebird@^3.5.0, bluebird@^3.5.5: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" @@ -6530,6 +6601,22 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + builtin-modules@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484" @@ -6689,6 +6776,14 @@ camel-case@^3.0.0: no-case "^2.2.0" upper-case "^1.1.1" +camel-case@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a" + integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw== + dependencies: + pascal-case "^3.1.2" + tslib "^2.0.3" + camelcase-css@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" @@ -6745,6 +6840,15 @@ caniuse-lite@1.0.30001283, caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, cani resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001283.tgz#8573685bdae4d733ef18f78d44ba0ca5fe9e896b" integrity sha512-9RoKo841j1GQFSJz/nCXOj0sD7tHBtlowjYlrqIUS812x9/emfBLBt6IyMz1zIaYc/eRL8Cs6HPUVi2Hzq4sIg== +capital-case@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" + integrity sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case-first "^2.0.2" + capitalize@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capitalize/-/capitalize-1.0.0.tgz#dc802c580aee101929020d2ca14b4ca8a0ae44be" @@ -6814,6 +6918,19 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^4.1.1, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.0.0.tgz#bd96c6bb8e02b96e08c0c3ee2a9d90e050c7b832" + integrity sha512-/duVOqst+luxCQRKEo4bNxinsOQtMP80ZYm7mMqzuh5PociNL0PvmHFvREJ9ueYL2TxlHjBcmLCdmocx9Vg+IQ== + change-case@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/change-case/-/change-case-3.1.0.tgz#0e611b7edc9952df2e8513b27b42de72647dd17e" @@ -6838,6 +6955,24 @@ change-case@^3.0.2: upper-case "^1.1.1" upper-case-first "^1.1.0" +change-case@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/change-case/-/change-case-4.1.2.tgz#fedfc5f136045e2398c0410ee441f95704641e12" + integrity sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A== + dependencies: + camel-case "^4.1.2" + capital-case "^1.0.4" + constant-case "^3.0.4" + dot-case "^3.0.4" + header-case "^2.0.4" + no-case "^3.0.4" + param-case "^3.0.4" + pascal-case "^3.1.2" + path-case "^3.0.4" + sentence-case "^3.0.4" + snake-case "^3.0.4" + tslib "^2.0.3" + char-regex@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" @@ -7038,6 +7173,13 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" +cli-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea" + integrity sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg== + dependencies: + restore-cursor "^4.0.0" + cli-select@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/cli-select/-/cli-select-1.1.2.tgz#456dced464b3346ca661b16a0e37fc4b28db4818" @@ -7053,6 +7195,11 @@ cli-spinners@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.3.0.tgz#0632239a4b5aa4c958610142c34bb7a651fc8df5" +cli-spinners@^2.5.0, cli-spinners@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" + integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== + cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" @@ -7387,6 +7534,15 @@ constant-case@^2.0.0: snake-case "^2.1.0" upper-case "^1.1.1" +constant-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1" + integrity sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case "^2.0.2" + constants-browserify@1.0.0, constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" @@ -8219,6 +8375,20 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" +del@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/del/-/del-6.0.0.tgz#0b40d0332cea743f1614f818be4feb717714c952" + integrity sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ== + dependencies: + globby "^11.0.1" + graceful-fs "^4.2.4" + is-glob "^4.0.1" + is-path-cwd "^2.2.0" + is-path-inside "^3.0.2" + p-map "^4.0.0" + rimraf "^3.0.2" + slash "^3.0.0" + delay@4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/delay/-/delay-4.3.0.tgz#efeebfb8f545579cb396b3a722443ec96d14c50e" @@ -8260,6 +8430,11 @@ detab@^2.0.0: dependencies: repeat-string "^1.5.4" +detect-file@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" + integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= + detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -8468,6 +8643,14 @@ dot-case@^2.1.0: dependencies: no-case "^2.2.0" +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + dot-prop@^4.1.0, dot-prop@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" @@ -9324,6 +9507,13 @@ expand-tilde@^1.2.2: dependencies: os-homedir "^1.0.1" +expand-tilde@^2.0.0, expand-tilde@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= + dependencies: + homedir-polyfill "^1.0.1" + expect@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.6.tgz#a4d74fbe27222c718fff68ef49d78e26a8fd4c05" @@ -9391,7 +9581,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@~3.0.2: +extend@^3.0.0, extend@^3.0.2, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -9481,7 +9671,7 @@ fast-glob@^3.1.1: micromatch "^4.0.2" picomatch "^2.2.1" -fast-glob@^3.2.5: +fast-glob@^3.2.5, fast-glob@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== @@ -9685,6 +9875,27 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +findup-sync@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-5.0.0.tgz#54380ad965a7edca00cc8f63113559aadc541bd2" + integrity sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ== + dependencies: + detect-file "^1.0.0" + is-glob "^4.0.3" + micromatch "^4.0.4" + resolve-dir "^1.0.1" + +fined@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fined/-/fined-2.0.0.tgz#6846563ed96879ce6de6c85c715c42250f8d8089" + integrity sha512-OFRzsL6ZMHz5s0JrsEr+TpdGNCtrVtnuG3x1yzGNiQHT0yaDnXAj8V/lWcpJVrnoDpcwXcASxAZYbuXda2Y82A== + dependencies: + expand-tilde "^2.0.2" + is-plain-object "^5.0.0" + object.defaults "^1.1.0" + object.pick "^1.3.0" + parse-filepath "^1.0.2" + firebase@7.14.5: version "7.14.5" resolved "https://registry.yarnpkg.com/firebase/-/firebase-7.14.5.tgz#cf1be9c7f0603c6c2f45f65c7d817f6b22114a4b" @@ -9705,6 +9916,11 @@ firebase@7.14.5: "@firebase/storage" "0.3.34" "@firebase/util" "0.2.47" +flagged-respawn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-2.0.0.tgz#abf39719dcfe1ac06c86c9466081c541c682987b" + integrity sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA== + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -9754,6 +9970,13 @@ for-own@^0.1.4: dependencies: for-in "^1.0.1" +for-own@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" + integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= + dependencies: + for-in "^1.0.1" + foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" @@ -10242,6 +10465,15 @@ global-modules@^0.2.3: global-prefix "^0.1.4" is-windows "^0.2.0" +global-modules@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== + dependencies: + global-prefix "^1.0.1" + is-windows "^1.0.1" + resolve-dir "^1.0.0" + global-prefix@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-0.1.5.tgz#8d3bc6b8da3ca8112a160d8d496ff0462bfef78f" @@ -10251,6 +10483,17 @@ global-prefix@^0.1.4: is-windows "^0.2.0" which "^1.2.12" +global-prefix@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= + dependencies: + expand-tilde "^2.0.2" + homedir-polyfill "^1.0.1" + ini "^1.3.4" + is-windows "^1.0.1" + which "^1.2.14" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -10321,6 +10564,18 @@ globby@^11.0.3: merge2 "^1.3.0" slash "^3.0.0" +globby@^12.0.2: + version "12.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-12.0.2.tgz#53788b2adf235602ed4cabfea5c70a1139e1ab11" + integrity sha512-lAsmb/5Lww4r7MM9nCCliDZVIKbZTavrsunAsHLr9oHthrZP1qi7/gAnHOsUs9bLvEt2vKVJhHmxuL7QbDuPdQ== + dependencies: + array-union "^3.0.1" + dir-glob "^3.0.1" + fast-glob "^3.2.7" + ignore "^5.1.8" + merge2 "^1.4.1" + slash "^4.0.0" + globby@^9.2.0: version "9.2.0" resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" @@ -10403,14 +10658,10 @@ got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.3, graceful-fs@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - -graceful-fs@^4.2.2: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.9: + version "4.2.9" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" + integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== "growl@~> 1.10.0": version "1.10.5" @@ -10441,6 +10692,18 @@ gzip-size@^6.0.0: dependencies: duplexer "^0.1.2" +handlebars@^4.4.3: + version "4.7.7" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" + integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== + dependencies: + minimist "^1.2.5" + neo-async "^2.6.0" + source-map "^0.6.1" + wordwrap "^1.0.0" + optionalDependencies: + uglify-js "^3.1.4" + handlebars@^4.7.6: version "4.7.6" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e" @@ -10684,6 +10947,14 @@ header-case@^1.0.0: no-case "^2.2.0" upper-case "^1.1.3" +header-case@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/header-case/-/header-case-2.0.4.tgz#5a42e63b55177349cf405beb8d775acabb92c063" + integrity sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q== + dependencies: + capital-case "^1.0.4" + tslib "^2.0.3" + hex-color-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" @@ -10704,7 +10975,7 @@ hoist-non-react-statics@^3.0.0: dependencies: react-is "^16.7.0" -homedir-polyfill@^1.0.0: +homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" dependencies: @@ -10902,6 +11173,11 @@ idb@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/idb/-/idb-3.0.2.tgz#c8e9122d5ddd40f13b60ae665e4862f8b13fa384" +ieee754@^1.1.13, ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ieee754@^1.1.4: version "1.1.13" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" @@ -10938,6 +11214,11 @@ ignore@^5.0.0, ignore@^5.1.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^5.1.8: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + image-size@0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.9.3.tgz#f7efce6b0a1649b44b9bc43b9d9a5acf272264b6" @@ -11108,6 +11389,26 @@ inquirer@7.3.3, inquirer@^7.3.3: strip-ansi "^6.0.0" through "^2.3.6" +inquirer@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.0.tgz#f44f008dd344bbfc4b30031f45d984e034a3ac3a" + integrity sha512-0crLweprevJ02tTuA6ThpoAERAGyVILC4sS74uib58Xf/zSr1/ZWtmm7D5CI+bSQEaA04f0K7idaHpQbSWgiVQ== + dependencies: + ansi-escapes "^4.2.1" + chalk "^4.1.1" + cli-cursor "^3.1.0" + cli-width "^3.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.21" + mute-stream "0.0.8" + ora "^5.4.1" + run-async "^2.4.0" + rxjs "^7.2.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + through "^2.3.6" + internal-slot@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" @@ -11122,6 +11423,11 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== +interpret@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" + integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== + ip@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" @@ -11135,6 +11441,14 @@ is-absolute-url@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" +is-absolute@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" + integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== + dependencies: + is-relative "^1.0.0" + is-windows "^1.0.1" + is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -11420,6 +11734,11 @@ is-interactive@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" +is-interactive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-2.0.0.tgz#40c57614593826da1100ade6059778d597f16e90" + integrity sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ== + is-lambda@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" @@ -11497,7 +11816,12 @@ is-observable@^1.1.0: dependencies: symbol-observable "^1.1.0" -is-path-inside@^3.0.1: +is-path-cwd@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" + integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== + +is-path-inside@^3.0.1, is-path-inside@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== @@ -11579,6 +11903,13 @@ is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" +is-relative@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" + integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== + dependencies: + is-unc-path "^1.0.0" + is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" @@ -11650,6 +11981,23 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" +is-unc-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" + integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== + dependencies: + unc-path-regex "^0.1.2" + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +is-unicode-supported@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-1.1.0.tgz#9127b71f9fa82f52ca5c20e982e7bec0ee31ee1e" + integrity sha512-lDcxivp8TJpLG75/DpatAqNzOpDPSpED8XNtrpBHTdQ2InQ1PbW78jhwSxyxhhu+xbVSast2X38bwj8atwoUQA== + is-upper-case@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/is-upper-case/-/is-upper-case-1.1.2.tgz#8d0b1fa7e7933a1e58483600ec7d9661cbaf756f" @@ -11676,7 +12024,7 @@ is-windows@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" -is-windows@^1.0.2: +is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -11707,6 +12055,11 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" +isbinaryfile@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.8.tgz#5d34b94865bd4946633ecc78a026fc76c5b11fcf" + integrity sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -12639,6 +12992,20 @@ lie@~3.3.0: dependencies: immediate "~3.0.5" +liftoff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-4.0.0.tgz#1a463b9073335cd425cdaa3b468996f7d66d2d81" + integrity sha512-rMGwYF8q7g2XhG2ulBmmJgWv25qBsqRbDn5gH0+wnuyeFt7QBJlHJmtg5qEdn4pN6WVAUMgXnIxytMFRX9c1aA== + dependencies: + extend "^3.0.2" + findup-sync "^5.0.0" + fined "^2.0.0" + flagged-respawn "^2.0.0" + is-plain-object "^5.0.0" + object.map "^1.0.1" + rechoir "^0.8.0" + resolve "^1.20.0" + limit-spawn@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/limit-spawn/-/limit-spawn-0.0.3.tgz#cc09c24467a0f0a1ed10a5196dba597cad3f65dc" @@ -12864,6 +13231,11 @@ lodash.foreach@^4.3.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53" +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= + lodash.includes@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" @@ -12991,6 +13363,22 @@ log-symbols@^3.0.0: dependencies: chalk "^2.4.2" +log-symbols@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +log-symbols@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-5.1.0.tgz#a20e3b9a5f53fac6aeb8e2bb22c07cf2c8f16d93" + integrity sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA== + dependencies: + chalk "^5.0.0" + is-unicode-supported "^1.1.0" + log-update@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" @@ -13040,6 +13428,13 @@ lower-case@^1.1.0, lower-case@^1.1.1, lower-case@^1.1.2: resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" @@ -13127,13 +13522,20 @@ make-fetch-happen@^8.0.9: socks-proxy-agent "^5.0.0" ssri "^8.0.0" +make-iterator@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" + integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== + dependencies: + kind-of "^6.0.2" + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" dependencies: tmpl "1.0.x" -map-cache@^0.2.2: +map-cache@^0.2.0, map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -13407,7 +13809,7 @@ merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" -merge2@^1.2.3, merge2@^1.3.0: +merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -14000,6 +14402,14 @@ no-case@^2.2.0, no-case@^2.3.2: dependencies: lower-case "^1.1.1" +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + node-dir@^0.1.17: version "0.1.17" resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.17.tgz#5f5665d93351335caabef8f1c554516cf5f1e4e5" @@ -14128,6 +14538,25 @@ node-notifier@8.0.1: uuid "^8.3.0" which "^2.0.2" +node-plop@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/node-plop/-/node-plop-0.30.0.tgz#413581d95ff21f043ec4c373fcacb0f1555ae600" + integrity sha512-5w9+jWoy9OtMm3qRmHgL2z/3L5VL3RhEegKkKC4tA1IIjG3aXf8Ee/8wdgU9qXyt1yDfPWI9Tan1rHpXAp0ZnA== + dependencies: + "@types/inquirer" "^8.1.3" + change-case "^4.1.2" + del "^6.0.0" + globby "^12.0.2" + handlebars "^4.4.3" + inquirer "^8.2.0" + isbinaryfile "^4.0.8" + lodash.get "^4.4.2" + lower-case "^2.0.2" + mkdirp "^1.0.4" + resolve "^1.20.0" + title-case "^3.0.3" + upper-case "^2.0.2" + node-pre-gyp@^0.13.0: version "0.13.0" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.13.0.tgz#df9ab7b68dd6498137717838e4f92a33fc9daa42" @@ -14471,6 +14900,16 @@ object.assign@^4.1.1, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" +object.defaults@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" + integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= + dependencies: + array-each "^1.0.1" + array-slice "^1.0.0" + for-own "^1.0.0" + isobject "^3.0.0" + object.entries@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.3.tgz#c601c7f168b62374541a07ddbd3e2d5e4f7711a6" @@ -14524,6 +14963,14 @@ object.hasown@^1.1.0: define-properties "^1.1.3" es-abstract "^1.19.1" +object.map@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" + integrity sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= + dependencies: + for-own "^1.0.0" + make-iterator "^1.0.0" + object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -14659,6 +15106,36 @@ ora@4.0.4: strip-ansi "^6.0.0" wcwidth "^1.0.1" +ora@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== + dependencies: + bl "^4.1.0" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.5.0" + is-interactive "^1.0.0" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + +ora@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-6.0.1.tgz#68caa9fd6c485a40d6f46c50a3940fa3df99c7f3" + integrity sha512-TDdKkKHdWE6jo/6pIa5U5AWcSVfpNRFJ8sdRJpioGNVPLAzZzHs/N+QhUfF7ZbyoC+rnDuNTKzeDJUbAza9g4g== + dependencies: + bl "^5.0.0" + chalk "^4.1.2" + cli-cursor "^4.0.0" + cli-spinners "^2.6.0" + is-interactive "^2.0.0" + is-unicode-supported "^1.1.0" + log-symbols "^5.0.0" + strip-ansi "^7.0.1" + wcwidth "^1.0.1" + os-browserify@0.3.0, os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" @@ -14876,6 +15353,14 @@ param-case@^2.1.0: dependencies: no-case "^2.2.0" +param-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" + integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -14928,6 +15413,15 @@ parse-entities@^2.0.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-filepath@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" + integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= + dependencies: + is-absolute "^1.0.0" + map-cache "^0.2.0" + path-root "^0.1.1" + parse-git-config@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-1.1.1.tgz#d3a9984317132f57398712bba438e129590ddf8c" @@ -15034,6 +15528,14 @@ pascal-case@^2.0.0: camel-case "^3.0.0" upper-case-first "^1.1.0" +pascal-case@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" + integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" @@ -15055,6 +15557,14 @@ path-case@^2.1.0: dependencies: no-case "^2.2.0" +path-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/path-case/-/path-case-3.0.4.tgz#9168645334eb942658375c56f80b4c0cb5f82c6f" + integrity sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" @@ -15094,6 +15604,18 @@ path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" +path-root-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= + +path-root@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= + dependencies: + path-root-regex "^0.1.0" + path-to-regexp@*, path-to-regexp@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.1.0.tgz#0b18f88b7a0ce0bfae6a25990c909ab86f512427" @@ -15268,6 +15790,20 @@ please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" +plop@3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/plop/-/plop-3.0.5.tgz#09720a3c28547ae3be0876b77313a981d56b6dcb" + integrity sha512-bD+/Lr+7NCjNIaYJq1cyHDfxtVCdjwfprgKsNwHwFnwntTiNwZWyxd1NuRDygdQWyPi+rstFMMFAPMek0cYaqA== + dependencies: + "@types/liftoff" "^4.0.0" + chalk "^5.0.0" + interpret "^2.2.0" + liftoff "^4.0.0" + minimist "^1.2.5" + node-plop "^0.30.0" + ora "^6.0.1" + v8flags "^4.0.0" + pluralize@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" @@ -16621,7 +17157,7 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.5.0, readable-stream@^3.6.0: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -16702,6 +17238,13 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== + dependencies: + resolve "^1.20.0" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -17056,6 +17599,14 @@ resolve-dir@^0.1.0: expand-tilde "^1.2.2" global-modules "^0.2.3" +resolve-dir@^1.0.0, resolve-dir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= + dependencies: + expand-tilde "^2.0.0" + global-modules "^1.0.0" + resolve-from@5.0.0, resolve-from@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" @@ -17130,6 +17681,14 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" +restore-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-4.0.0.tgz#519560a4318975096def6e609d44100edaa4ccb9" + integrity sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -17318,6 +17877,13 @@ rxjs@^6.3.3, rxjs@^6.6.0: dependencies: tslib "^1.9.0" +rxjs@^7.2.0: + version "7.5.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.1.tgz#af73df343cbcab37628197f43ea0c8256f54b157" + integrity sha512-KExVEeZWxMZnZhUZtsJcFwz8IvPvgu4G2Z2QyqjZQzUGr32KDYuSxrEYO4w3tFFNbfLozcrKUTvTPi+E9ywJkQ== + dependencies: + tslib "^2.1.0" + sade@^1.7.4: version "1.7.4" resolved "https://registry.yarnpkg.com/sade/-/sade-1.7.4.tgz#ea681e0c65d248d2095c90578c03ca0bb1b54691" @@ -17518,6 +18084,15 @@ sentence-case@^2.1.0: no-case "^2.2.0" upper-case-first "^1.1.2" +sentence-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-3.0.4.tgz#3645a7b8c117c787fde8702056225bb62a45131f" + integrity sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case-first "^2.0.2" + serialize-javascript@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-3.1.0.tgz#8bf3a9170712664ef2561b44b691eafe399214ea" @@ -17682,6 +18257,11 @@ slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" +slash@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" + integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -17715,6 +18295,14 @@ snake-case@^2.1.0: dependencies: no-case "^2.2.0" +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -18262,6 +18850,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" + integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -18777,6 +19372,13 @@ title-case@^2.1.0: no-case "^2.2.0" upper-case "^1.0.3" +title-case@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/title-case/-/title-case-3.0.3.tgz#bc689b46f02e411f1d1e1d081f7c3deca0489982" + integrity sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA== + dependencies: + tslib "^2.0.3" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -18973,7 +19575,7 @@ tslib@2.0.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== -tslib@^2.0.0, tslib@^2.3.0, tslib@^2.3.1: +tslib@^2.0.0, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== @@ -19229,6 +19831,11 @@ unbox-primitive@^1.0.1: has-symbols "^1.0.2" which-boxed-primitive "^1.0.2" +unc-path-regex@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= + unfetch@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.1.0.tgz#6ec2dd0de887e58a4dee83a050ded80ffc4137db" @@ -19575,11 +20182,25 @@ upper-case-first@^1.1.0, upper-case-first@^1.1.2: dependencies: upper-case "^1.1.1" +upper-case-first@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-2.0.2.tgz#992c3273f882abd19d1e02894cc147117f844324" + integrity sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg== + dependencies: + tslib "^2.0.3" + upper-case@^1.0.3, upper-case@^1.1.0, upper-case@^1.1.1, upper-case@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= +upper-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-2.0.2.tgz#d89810823faab1df1549b7d97a76f8662bae6f7a" + integrity sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg== + dependencies: + tslib "^2.0.3" + uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" @@ -19698,6 +20319,11 @@ v8-to-istanbul@^8.0.0: convert-source-map "^1.6.0" source-map "^0.7.3" +v8flags@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-4.0.0.tgz#dcacd1e0b20a7919cc48022b1bf2d95adb175e83" + integrity sha512-83N0OkTbn6gOjJ2awNuzuK4czeGxwEwBoTqlhBZhnp8o0IJ72mXRQKphj/azwRf3acbDJZYZhbOPEJHd884ELg== + validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -20115,7 +20741,7 @@ which@1.2.x: dependencies: isexe "^2.0.0" -which@^1.2.12, which@^1.2.8, which@^1.2.9, which@^1.3.1: +which@^1.2.12, which@^1.2.14, which@^1.2.8, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" dependencies: